home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / Think C From Scratch / Think C⁄C++ From Scratch / Think C_C++ From Scratch / cards.xml < prev    next >
Encoding:
Text File  |  1994-02-10  |  770.8 KB  |  19,084 lines

  1. card_2878.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>2878</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_5916.pbm</bitmap>
  8.     <cantDelete> <true /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>2698</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13.     <part>
  14.         <id>8</id>
  15.         <type>button</type>
  16.         <visible> <true /> </visible>
  17.         <reserved5> 0 </reserved5>
  18.         <reserved4> 0 </reserved4>
  19.         <reserved3> 0 </reserved3>
  20.         <reserved2> 0 </reserved2>
  21.         <reserved1> 0 </reserved1>
  22.         <enabled> <true /> </enabled>
  23.         <rect>
  24.             <left>57</left>
  25.             <top>61</top>
  26.             <right>449</right>
  27.             <bottom>240</bottom>
  28.         </rect>
  29.         <style>rectangle</style>
  30.         <showName> <false /> </showName>
  31.         <highlight> <false /> </highlight>
  32.         <autoHighlight> <false /> </autoHighlight>
  33.         <sharedHighlight> <true /> </sharedHighlight>
  34.         <family>0</family>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>0</icon>
  37.         <textAlign>center</textAlign>
  38.         <font>Chicago</font>
  39.         <textSize>12</textSize>
  40.         <textStyle>plain</textStyle>
  41.         <name></name>
  42.         <script></script>
  43.     </part>
  44.     <part>
  45.         <id>2</id>
  46.         <type>field</type>
  47.         <visible> <true /> </visible>
  48.         <dontWrap> <false /> </dontWrap>
  49.         <dontSearch> <false /> </dontSearch>
  50.         <sharedText> <false /> </sharedText>
  51.         <fixedLineHeight> <false /> </fixedLineHeight>
  52.         <autoTab> <false /> </autoTab>
  53.         <lockText> <false /> </lockText>
  54.         <rect>
  55.             <left>75</left>
  56.             <top>71</top>
  57.             <right>433</right>
  58.             <bottom>96</bottom>
  59.         </rect>
  60.         <style>transparent</style>
  61.         <autoSelect> <false /> </autoSelect>
  62.         <showLines> <false /> </showLines>
  63.         <wideMargins> <false /> </wideMargins>
  64.         <multipleLines> <false /> </multipleLines>
  65.         <reservedFamily> 0 </reservedFamily>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>0</icon>
  68.         <textAlign>center</textAlign>
  69.         <font>Palatino</font>
  70.         <textSize>18</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <textHeight>24</textHeight>
  73.         <name>title</name>
  74.         <script></script>
  75.     </part>
  76.     <part>
  77.         <id>3</id>
  78.         <type>field</type>
  79.         <visible> <true /> </visible>
  80.         <dontWrap> <false /> </dontWrap>
  81.         <dontSearch> <false /> </dontSearch>
  82.         <sharedText> <false /> </sharedText>
  83.         <fixedLineHeight> <false /> </fixedLineHeight>
  84.         <autoTab> <false /> </autoTab>
  85.         <lockText> <false /> </lockText>
  86.         <rect>
  87.             <left>75</left>
  88.             <top>100</top>
  89.             <right>433</right>
  90.             <bottom>234</bottom>
  91.         </rect>
  92.         <style>transparent</style>
  93.         <autoSelect> <false /> </autoSelect>
  94.         <showLines> <false /> </showLines>
  95.         <wideMargins> <false /> </wideMargins>
  96.         <multipleLines> <false /> </multipleLines>
  97.         <reservedFamily> 0 </reservedFamily>
  98.         <titleWidth>0</titleWidth>
  99.         <icon>0</icon>
  100.         <textAlign>left</textAlign>
  101.         <font>Palatino</font>
  102.         <textSize>12</textSize>
  103.         <textStyle>plain</textStyle>
  104.         <textHeight>16</textHeight>
  105.         <name>description</name>
  106.         <script></script>
  107.     </part>
  108.     <part>
  109.         <id>13</id>
  110.         <type>button</type>
  111.         <visible> <true /> </visible>
  112.         <reserved5> 0 </reserved5>
  113.         <reserved4> 0 </reserved4>
  114.         <reserved3> 0 </reserved3>
  115.         <reserved2> 0 </reserved2>
  116.         <reserved1> 0 </reserved1>
  117.         <enabled> <true /> </enabled>
  118.         <rect>
  119.             <left>162</left>
  120.             <top>261</top>
  121.             <right>235</right>
  122.             <bottom>283</bottom>
  123.         </rect>
  124.         <style>roundrect</style>
  125.         <showName> <true /> </showName>
  126.         <highlight> <false /> </highlight>
  127.         <autoHighlight> <true /> </autoHighlight>
  128.         <sharedHighlight> <true /> </sharedHighlight>
  129.         <family>0</family>
  130.         <titleWidth>0</titleWidth>
  131.         <icon>0</icon>
  132.         <textAlign>center</textAlign>
  133.         <font>Chicago</font>
  134.         <textSize>12</textSize>
  135.         <textStyle>plain</textStyle>
  136.         <name>Contents</name>
  137.         <script>on mouseUp
  138. visual wipe left to black
  139. visual wipe left
  140. go card "contents"
  141. end mouseUp
  142. </script>
  143.     </part>
  144.     <part>
  145.         <id>12</id>
  146.         <type>button</type>
  147.         <visible> <true /> </visible>
  148.         <reserved5> 0 </reserved5>
  149.         <reserved4> 0 </reserved4>
  150.         <reserved3> 0 </reserved3>
  151.         <reserved2> 0 </reserved2>
  152.         <reserved1> 0 </reserved1>
  153.         <enabled> <true /> </enabled>
  154.         <rect>
  155.             <left>254</left>
  156.             <top>261</top>
  157.             <right>327</right>
  158.             <bottom>283</bottom>
  159.         </rect>
  160.         <style>roundrect</style>
  161.         <showName> <true /> </showName>
  162.         <highlight> <false /> </highlight>
  163.         <autoHighlight> <true /> </autoHighlight>
  164.         <sharedHighlight> <true /> </sharedHighlight>
  165.         <family>0</family>
  166.         <titleWidth>0</titleWidth>
  167.         <icon>0</icon>
  168.         <textAlign>center</textAlign>
  169.         <font>Chicago</font>
  170.         <textSize>12</textSize>
  171.         <textStyle>plain</textStyle>
  172.         <name>Help</name>
  173.         <script>on mouseUp
  174. visual dissolve
  175. go card "help"
  176. end mouseUp
  177. </script>
  178.     </part>
  179.     <part>
  180.         <id>14</id>
  181.         <type>button</type>
  182.         <visible> <true /> </visible>
  183.         <reserved5> 0 </reserved5>
  184.         <reserved4> 0 </reserved4>
  185.         <reserved3> 0 </reserved3>
  186.         <reserved2> 0 </reserved2>
  187.         <reserved1> 0 </reserved1>
  188.         <enabled> <true /> </enabled>
  189.         <rect>
  190.             <left>55</left>
  191.             <top>59</top>
  192.             <right>451</right>
  193.             <bottom>242</bottom>
  194.         </rect>
  195.         <style>transparent</style>
  196.         <showName> <false /> </showName>
  197.         <highlight> <false /> </highlight>
  198.         <autoHighlight> <false /> </autoHighlight>
  199.         <sharedHighlight> <true /> </sharedHighlight>
  200.         <family>0</family>
  201.         <titleWidth>0</titleWidth>
  202.         <icon>0</icon>
  203.         <textAlign>center</textAlign>
  204.         <font>Chicago</font>
  205.         <textSize>12</textSize>
  206.         <textStyle>plain</textStyle>
  207.         <name></name>
  208.         <script>on mouseUp
  209. visual wipe left to black
  210. visual wipe left
  211. go card "contents"
  212. end mouseUp
  213. </script>
  214.     </part>
  215.     <content>
  216.         <layer>card</layer>
  217.         <id>2</id>
  218.         <text>Think C/C++ From Scratch   </text>
  219.     </content>
  220.     <content>
  221.         <layer>card</layer>
  222.         <id>3</id>
  223.         <text><span class="style3">n introduction to programming using an object-oriented extension to the C language, Symantec Corporation's Think C 5.0 for Macintosh computers.  Also suitable as an introduction to the C++ language.  No C programming experience is assumed.
  224. </span><span class="style21">
  225. </span><span class="style3">Includes sample code for graphics and for studying application frameworks.
  226.  
  227. Price: $20. Ralph Gonzalez, PO Box 54, Newark, DE 19711.</span></text>
  228.     </content>
  229.     <name>title</name>
  230.     <script>on openCard
  231. put "" into card field "return card" of card "help"
  232. end openCard
  233.  
  234. on arrowKey choice
  235. if choice is "right" then
  236. visual wipe left to black
  237. visual wipe left
  238. end if
  239. pass arrowKey
  240. end arrowKey
  241. </script>
  242. </card>
  243.  
  244.  
  245. card_5268.xml
  246. <?xml version="1.0" encoding="utf-8" ?>
  247. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  248. <card>
  249.     <id>5268</id>
  250.     <filler1>0</filler1>
  251.     <cantDelete> <true /> </cantDelete>
  252.     <showPict> <true /> </showPict>
  253.     <dontSearch> <false /> </dontSearch>
  254.     <owner>4755</owner>
  255.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  256.     <part>
  257.         <id>26</id>
  258.         <type>button</type>
  259.         <visible> <true /> </visible>
  260.         <reserved5> 0 </reserved5>
  261.         <reserved4> 0 </reserved4>
  262.         <reserved3> 0 </reserved3>
  263.         <reserved2> 0 </reserved2>
  264.         <reserved1> 0 </reserved1>
  265.         <enabled> <true /> </enabled>
  266.         <rect>
  267.             <left>7</left>
  268.             <top>58</top>
  269.             <right>502</right>
  270.             <bottom>301</bottom>
  271.         </rect>
  272.         <style>transparent</style>
  273.         <showName> <false /> </showName>
  274.         <highlight> <false /> </highlight>
  275.         <autoHighlight> <false /> </autoHighlight>
  276.         <sharedHighlight> <true /> </sharedHighlight>
  277.         <family>0</family>
  278.         <titleWidth>0</titleWidth>
  279.         <icon>0</icon>
  280.         <textAlign>center</textAlign>
  281.         <font>Chicago</font>
  282.         <textSize>12</textSize>
  283.         <textStyle>plain</textStyle>
  284.         <name></name>
  285.         <script></script>
  286.     </part>
  287.     <part>
  288.         <id>12</id>
  289.         <type>button</type>
  290.         <visible> <true /> </visible>
  291.         <reserved5> 0 </reserved5>
  292.         <reserved4> 0 </reserved4>
  293.         <reserved3> 0 </reserved3>
  294.         <reserved2> 0 </reserved2>
  295.         <reserved1> 0 </reserved1>
  296.         <enabled> <true /> </enabled>
  297.         <rect>
  298.             <left>10</left>
  299.             <top>310</top>
  300.             <right>43</right>
  301.             <bottom>334</bottom>
  302.         </rect>
  303.         <style>transparent</style>
  304.         <showName> <false /> </showName>
  305.         <highlight> <false /> </highlight>
  306.         <autoHighlight> <false /> </autoHighlight>
  307.         <sharedHighlight> <true /> </sharedHighlight>
  308.         <family>0</family>
  309.         <titleWidth>0</titleWidth>
  310.         <icon>1011</icon>
  311.         <textAlign>center</textAlign>
  312.         <font>Chicago</font>
  313.         <textSize>12</textSize>
  314.         <textStyle>plain</textStyle>
  315.         <name>Home Stack</name>
  316.         <script>on mouseUp
  317. visual dissolve
  318. go "home"
  319. end mouseUp
  320. </script>
  321.     </part>
  322.     <part>
  323.         <id>14</id>
  324.         <type>field</type>
  325.         <visible> <false /> </visible>
  326.         <dontWrap> <false /> </dontWrap>
  327.         <dontSearch> <false /> </dontSearch>
  328.         <sharedText> <false /> </sharedText>
  329.         <fixedLineHeight> <true /> </fixedLineHeight>
  330.         <autoTab> <false /> </autoTab>
  331.         <lockText> <false /> </lockText>
  332.         <rect>
  333.             <left>141</left>
  334.             <top>21</top>
  335.             <right>237</right>
  336.             <bottom>36</bottom>
  337.         </rect>
  338.         <style>transparent</style>
  339.         <autoSelect> <false /> </autoSelect>
  340.         <showLines> <false /> </showLines>
  341.         <wideMargins> <false /> </wideMargins>
  342.         <multipleLines> <false /> </multipleLines>
  343.         <reservedFamily> 0 </reservedFamily>
  344.         <titleWidth>0</titleWidth>
  345.         <icon>0</icon>
  346.         <textAlign>left</textAlign>
  347.         <font>Palatino</font>
  348.         <textSize>12</textSize>
  349.         <textStyle>plain</textStyle>
  350.         <textHeight>16</textHeight>
  351.         <name>bookmark1</name>
  352.         <script></script>
  353.     </part>
  354.     <part>
  355.         <id>20</id>
  356.         <type>field</type>
  357.         <visible> <true /> </visible>
  358.         <dontWrap> <false /> </dontWrap>
  359.         <dontSearch> <false /> </dontSearch>
  360.         <sharedText> <false /> </sharedText>
  361.         <fixedLineHeight> <false /> </fixedLineHeight>
  362.         <autoTab> <false /> </autoTab>
  363.         <lockText> <true /> </lockText>
  364.         <rect>
  365.             <left>118</left>
  366.             <top>37</top>
  367.             <right>355</right>
  368.             <bottom>55</bottom>
  369.         </rect>
  370.         <style>transparent</style>
  371.         <autoSelect> <false /> </autoSelect>
  372.         <showLines> <false /> </showLines>
  373.         <wideMargins> <false /> </wideMargins>
  374.         <multipleLines> <false /> </multipleLines>
  375.         <reservedFamily> 0 </reservedFamily>
  376.         <titleWidth>0</titleWidth>
  377.         <icon>0</icon>
  378.         <textAlign>left</textAlign>
  379.         <font>Palatino</font>
  380.         <textSize>10</textSize>
  381.         <textStyle>plain</textStyle>
  382.         <textHeight>13</textHeight>
  383.         <name>instructions</name>
  384.         <script></script>
  385.     </part>
  386.     <part>
  387.         <id>21</id>
  388.         <type>button</type>
  389.         <visible> <true /> </visible>
  390.         <reserved5> 0 </reserved5>
  391.         <reserved4> 0 </reserved4>
  392.         <reserved3> 0 </reserved3>
  393.         <reserved2> 0 </reserved2>
  394.         <reserved1> 0 </reserved1>
  395.         <enabled> <true /> </enabled>
  396.         <rect>
  397.             <left>424</left>
  398.             <top>314</top>
  399.             <right>453</right>
  400.             <bottom>337</bottom>
  401.         </rect>
  402.         <style>transparent</style>
  403.         <showName> <false /> </showName>
  404.         <highlight> <false /> </highlight>
  405.         <autoHighlight> <false /> </autoHighlight>
  406.         <sharedHighlight> <true /> </sharedHighlight>
  407.         <family>0</family>
  408.         <titleWidth>0</titleWidth>
  409.         <icon>1014</icon>
  410.         <textAlign>center</textAlign>
  411.         <font>Chicago</font>
  412.         <textSize>12</textSize>
  413.         <textStyle>plain</textStyle>
  414.         <name></name>
  415.         <script>on mouseUp
  416. visual effect wipe right to black
  417. visual wipe right
  418. go to previous card
  419. end mouseUp</script>
  420.     </part>
  421.     <part>
  422.         <id>24</id>
  423.         <type>field</type>
  424.         <visible> <false /> </visible>
  425.         <dontWrap> <false /> </dontWrap>
  426.         <dontSearch> <false /> </dontSearch>
  427.         <sharedText> <false /> </sharedText>
  428.         <fixedLineHeight> <true /> </fixedLineHeight>
  429.         <autoTab> <false /> </autoTab>
  430.         <lockText> <false /> </lockText>
  431.         <rect>
  432.             <left>237</left>
  433.             <top>21</top>
  434.             <right>333</right>
  435.             <bottom>36</bottom>
  436.         </rect>
  437.         <style>transparent</style>
  438.         <autoSelect> <false /> </autoSelect>
  439.         <showLines> <false /> </showLines>
  440.         <wideMargins> <false /> </wideMargins>
  441.         <multipleLines> <false /> </multipleLines>
  442.         <reservedFamily> 0 </reservedFamily>
  443.         <titleWidth>0</titleWidth>
  444.         <icon>0</icon>
  445.         <textAlign>left</textAlign>
  446.         <font>Palatino</font>
  447.         <textSize>12</textSize>
  448.         <textStyle>plain</textStyle>
  449.         <textHeight>16</textHeight>
  450.         <name>bookmark2</name>
  451.         <script></script>
  452.     </part>
  453.     <part>
  454.         <id>25</id>
  455.         <type>field</type>
  456.         <visible> <false /> </visible>
  457.         <dontWrap> <false /> </dontWrap>
  458.         <dontSearch> <false /> </dontSearch>
  459.         <sharedText> <false /> </sharedText>
  460.         <fixedLineHeight> <true /> </fixedLineHeight>
  461.         <autoTab> <false /> </autoTab>
  462.         <lockText> <false /> </lockText>
  463.         <rect>
  464.             <left>333</left>
  465.             <top>21</top>
  466.             <right>429</right>
  467.             <bottom>36</bottom>
  468.         </rect>
  469.         <style>transparent</style>
  470.         <autoSelect> <false /> </autoSelect>
  471.         <showLines> <false /> </showLines>
  472.         <wideMargins> <false /> </wideMargins>
  473.         <multipleLines> <false /> </multipleLines>
  474.         <reservedFamily> 0 </reservedFamily>
  475.         <titleWidth>0</titleWidth>
  476.         <icon>0</icon>
  477.         <textAlign>left</textAlign>
  478.         <font>Palatino</font>
  479.         <textSize>12</textSize>
  480.         <textStyle>plain</textStyle>
  481.         <textHeight>16</textHeight>
  482.         <name>bookmark3</name>
  483.         <script></script>
  484.     </part>
  485.     <part>
  486.         <id>29</id>
  487.         <type>field</type>
  488.         <visible> <true /> </visible>
  489.         <dontWrap> <false /> </dontWrap>
  490.         <dontSearch> <false /> </dontSearch>
  491.         <sharedText> <false /> </sharedText>
  492.         <fixedLineHeight> <true /> </fixedLineHeight>
  493.         <autoTab> <false /> </autoTab>
  494.         <lockText> <true /> </lockText>
  495.         <rect>
  496.             <left>190</left>
  497.             <top>60</top>
  498.             <right>233</right>
  499.             <bottom>74</bottom>
  500.         </rect>
  501.         <style>transparent</style>
  502.         <autoSelect> <false /> </autoSelect>
  503.         <showLines> <false /> </showLines>
  504.         <wideMargins> <false /> </wideMargins>
  505.         <multipleLines> <false /> </multipleLines>
  506.         <reservedFamily> 0 </reservedFamily>
  507.         <titleWidth>0</titleWidth>
  508.         <icon>0</icon>
  509.         <textAlign>right</textAlign>
  510.         <font>Palatino</font>
  511.         <textSize>10</textSize>
  512.         <textStyle>plain</textStyle>
  513.         <textHeight>13</textHeight>
  514.         <name></name>
  515.         <script></script>
  516.     </part>
  517.     <part>
  518.         <id>28</id>
  519.         <type>field</type>
  520.         <visible> <true /> </visible>
  521.         <dontWrap> <false /> </dontWrap>
  522.         <dontSearch> <false /> </dontSearch>
  523.         <sharedText> <false /> </sharedText>
  524.         <fixedLineHeight> <true /> </fixedLineHeight>
  525.         <autoTab> <false /> </autoTab>
  526.         <lockText> <true /> </lockText>
  527.         <rect>
  528.             <left>14</left>
  529.             <top>60</top>
  530.             <right>233</right>
  531.             <bottom>74</bottom>
  532.         </rect>
  533.         <style>transparent</style>
  534.         <autoSelect> <false /> </autoSelect>
  535.         <showLines> <false /> </showLines>
  536.         <wideMargins> <false /> </wideMargins>
  537.         <multipleLines> <false /> </multipleLines>
  538.         <reservedFamily> 0 </reservedFamily>
  539.         <titleWidth>0</titleWidth>
  540.         <icon>0</icon>
  541.         <textAlign>left</textAlign>
  542.         <font>Palatino</font>
  543.         <textSize>10</textSize>
  544.         <textStyle>plain</textStyle>
  545.         <textHeight>13</textHeight>
  546.         <name></name>
  547.         <script>on mouseUp
  548. visual iris open
  549. get the number of the target
  550. get card field (it-1)
  551. if it is not "" then
  552. go card it
  553. end if
  554. end mouseUp
  555. </script>
  556.     </part>
  557.     <part>
  558.         <id>31</id>
  559.         <type>field</type>
  560.         <visible> <true /> </visible>
  561.         <dontWrap> <false /> </dontWrap>
  562.         <dontSearch> <false /> </dontSearch>
  563.         <sharedText> <false /> </sharedText>
  564.         <fixedLineHeight> <true /> </fixedLineHeight>
  565.         <autoTab> <false /> </autoTab>
  566.         <lockText> <true /> </lockText>
  567.         <rect>
  568.             <left>190</left>
  569.             <top>73</top>
  570.             <right>233</right>
  571.             <bottom>87</bottom>
  572.         </rect>
  573.         <style>transparent</style>
  574.         <autoSelect> <false /> </autoSelect>
  575.         <showLines> <false /> </showLines>
  576.         <wideMargins> <false /> </wideMargins>
  577.         <multipleLines> <false /> </multipleLines>
  578.         <reservedFamily> 0 </reservedFamily>
  579.         <titleWidth>0</titleWidth>
  580.         <icon>0</icon>
  581.         <textAlign>right</textAlign>
  582.         <font>Palatino</font>
  583.         <textSize>10</textSize>
  584.         <textStyle>plain</textStyle>
  585.         <textHeight>13</textHeight>
  586.         <name></name>
  587.         <script></script>
  588.     </part>
  589.     <part>
  590.         <id>30</id>
  591.         <type>field</type>
  592.         <visible> <true /> </visible>
  593.         <dontWrap> <false /> </dontWrap>
  594.         <dontSearch> <false /> </dontSearch>
  595.         <sharedText> <false /> </sharedText>
  596.         <fixedLineHeight> <true /> </fixedLineHeight>
  597.         <autoTab> <false /> </autoTab>
  598.         <lockText> <true /> </lockText>
  599.         <rect>
  600.             <left>14</left>
  601.             <top>73</top>
  602.             <right>233</right>
  603.             <bottom>87</bottom>
  604.         </rect>
  605.         <style>transparent</style>
  606.         <autoSelect> <false /> </autoSelect>
  607.         <showLines> <false /> </showLines>
  608.         <wideMargins> <false /> </wideMargins>
  609.         <multipleLines> <false /> </multipleLines>
  610.         <reservedFamily> 0 </reservedFamily>
  611.         <titleWidth>0</titleWidth>
  612.         <icon>0</icon>
  613.         <textAlign>left</textAlign>
  614.         <font>Palatino</font>
  615.         <textSize>10</textSize>
  616.         <textStyle>plain</textStyle>
  617.         <textHeight>13</textHeight>
  618.         <name></name>
  619.         <script>on mouseUp
  620. visual iris open
  621. get the number of the target
  622. get card field (it-1)
  623. if it is not "" then
  624. go card it
  625. end if
  626. end mouseUp
  627. </script>
  628.     </part>
  629.     <part>
  630.         <id>33</id>
  631.         <type>field</type>
  632.         <visible> <true /> </visible>
  633.         <dontWrap> <false /> </dontWrap>
  634.         <dontSearch> <false /> </dontSearch>
  635.         <sharedText> <false /> </sharedText>
  636.         <fixedLineHeight> <true /> </fixedLineHeight>
  637.         <autoTab> <false /> </autoTab>
  638.         <lockText> <true /> </lockText>
  639.         <rect>
  640.             <left>190</left>
  641.             <top>86</top>
  642.             <right>233</right>
  643.             <bottom>100</bottom>
  644.         </rect>
  645.         <style>transparent</style>
  646.         <autoSelect> <false /> </autoSelect>
  647.         <showLines> <false /> </showLines>
  648.         <wideMargins> <false /> </wideMargins>
  649.         <multipleLines> <false /> </multipleLines>
  650.         <reservedFamily> 0 </reservedFamily>
  651.         <titleWidth>0</titleWidth>
  652.         <icon>0</icon>
  653.         <textAlign>right</textAlign>
  654.         <font>Palatino</font>
  655.         <textSize>10</textSize>
  656.         <textStyle>plain</textStyle>
  657.         <textHeight>13</textHeight>
  658.         <name></name>
  659.         <script></script>
  660.     </part>
  661.     <part>
  662.         <id>32</id>
  663.         <type>field</type>
  664.         <visible> <true /> </visible>
  665.         <dontWrap> <false /> </dontWrap>
  666.         <dontSearch> <false /> </dontSearch>
  667.         <sharedText> <false /> </sharedText>
  668.         <fixedLineHeight> <true /> </fixedLineHeight>
  669.         <autoTab> <false /> </autoTab>
  670.         <lockText> <true /> </lockText>
  671.         <rect>
  672.             <left>14</left>
  673.             <top>86</top>
  674.             <right>233</right>
  675.             <bottom>100</bottom>
  676.         </rect>
  677.         <style>transparent</style>
  678.         <autoSelect> <false /> </autoSelect>
  679.         <showLines> <false /> </showLines>
  680.         <wideMargins> <false /> </wideMargins>
  681.         <multipleLines> <false /> </multipleLines>
  682.         <reservedFamily> 0 </reservedFamily>
  683.         <titleWidth>0</titleWidth>
  684.         <icon>0</icon>
  685.         <textAlign>left</textAlign>
  686.         <font>Palatino</font>
  687.         <textSize>10</textSize>
  688.         <textStyle>plain</textStyle>
  689.         <textHeight>13</textHeight>
  690.         <name></name>
  691.         <script>on mouseUp
  692. visual iris open
  693. get the number of the target
  694. get card field (it-1)
  695. if it is not "" then
  696. go card it
  697. end if
  698. end mouseUp
  699. </script>
  700.     </part>
  701.     <part>
  702.         <id>35</id>
  703.         <type>field</type>
  704.         <visible> <true /> </visible>
  705.         <dontWrap> <false /> </dontWrap>
  706.         <dontSearch> <false /> </dontSearch>
  707.         <sharedText> <false /> </sharedText>
  708.         <fixedLineHeight> <true /> </fixedLineHeight>
  709.         <autoTab> <false /> </autoTab>
  710.         <lockText> <true /> </lockText>
  711.         <rect>
  712.             <left>190</left>
  713.             <top>99</top>
  714.             <right>233</right>
  715.             <bottom>113</bottom>
  716.         </rect>
  717.         <style>transparent</style>
  718.         <autoSelect> <false /> </autoSelect>
  719.         <showLines> <false /> </showLines>
  720.         <wideMargins> <false /> </wideMargins>
  721.         <multipleLines> <false /> </multipleLines>
  722.         <reservedFamily> 0 </reservedFamily>
  723.         <titleWidth>0</titleWidth>
  724.         <icon>0</icon>
  725.         <textAlign>right</textAlign>
  726.         <font>Palatino</font>
  727.         <textSize>10</textSize>
  728.         <textStyle>plain</textStyle>
  729.         <textHeight>13</textHeight>
  730.         <name></name>
  731.         <script></script>
  732.     </part>
  733.     <part>
  734.         <id>34</id>
  735.         <type>field</type>
  736.         <visible> <true /> </visible>
  737.         <dontWrap> <false /> </dontWrap>
  738.         <dontSearch> <false /> </dontSearch>
  739.         <sharedText> <false /> </sharedText>
  740.         <fixedLineHeight> <true /> </fixedLineHeight>
  741.         <autoTab> <false /> </autoTab>
  742.         <lockText> <true /> </lockText>
  743.         <rect>
  744.             <left>14</left>
  745.             <top>99</top>
  746.             <right>233</right>
  747.             <bottom>113</bottom>
  748.         </rect>
  749.         <style>transparent</style>
  750.         <autoSelect> <false /> </autoSelect>
  751.         <showLines> <false /> </showLines>
  752.         <wideMargins> <false /> </wideMargins>
  753.         <multipleLines> <false /> </multipleLines>
  754.         <reservedFamily> 0 </reservedFamily>
  755.         <titleWidth>0</titleWidth>
  756.         <icon>0</icon>
  757.         <textAlign>left</textAlign>
  758.         <font>Palatino</font>
  759.         <textSize>10</textSize>
  760.         <textStyle>plain</textStyle>
  761.         <textHeight>13</textHeight>
  762.         <name></name>
  763.         <script>on mouseUp
  764. visual iris open
  765. get the number of the target
  766. get card field (it-1)
  767. if it is not "" then
  768. go card it
  769. end if
  770. end mouseUp
  771. </script>
  772.     </part>
  773.     <part>
  774.         <id>37</id>
  775.         <type>field</type>
  776.         <visible> <true /> </visible>
  777.         <dontWrap> <false /> </dontWrap>
  778.         <dontSearch> <false /> </dontSearch>
  779.         <sharedText> <false /> </sharedText>
  780.         <fixedLineHeight> <true /> </fixedLineHeight>
  781.         <autoTab> <false /> </autoTab>
  782.         <lockText> <true /> </lockText>
  783.         <rect>
  784.             <left>190</left>
  785.             <top>112</top>
  786.             <right>233</right>
  787.             <bottom>126</bottom>
  788.         </rect>
  789.         <style>transparent</style>
  790.         <autoSelect> <false /> </autoSelect>
  791.         <showLines> <false /> </showLines>
  792.         <wideMargins> <false /> </wideMargins>
  793.         <multipleLines> <false /> </multipleLines>
  794.         <reservedFamily> 0 </reservedFamily>
  795.         <titleWidth>0</titleWidth>
  796.         <icon>0</icon>
  797.         <textAlign>right</textAlign>
  798.         <font>Palatino</font>
  799.         <textSize>10</textSize>
  800.         <textStyle>plain</textStyle>
  801.         <textHeight>13</textHeight>
  802.         <name></name>
  803.         <script></script>
  804.     </part>
  805.     <part>
  806.         <id>36</id>
  807.         <type>field</type>
  808.         <visible> <true /> </visible>
  809.         <dontWrap> <false /> </dontWrap>
  810.         <dontSearch> <false /> </dontSearch>
  811.         <sharedText> <false /> </sharedText>
  812.         <fixedLineHeight> <true /> </fixedLineHeight>
  813.         <autoTab> <false /> </autoTab>
  814.         <lockText> <true /> </lockText>
  815.         <rect>
  816.             <left>14</left>
  817.             <top>112</top>
  818.             <right>233</right>
  819.             <bottom>126</bottom>
  820.         </rect>
  821.         <style>transparent</style>
  822.         <autoSelect> <false /> </autoSelect>
  823.         <showLines> <false /> </showLines>
  824.         <wideMargins> <false /> </wideMargins>
  825.         <multipleLines> <false /> </multipleLines>
  826.         <reservedFamily> 0 </reservedFamily>
  827.         <titleWidth>0</titleWidth>
  828.         <icon>0</icon>
  829.         <textAlign>left</textAlign>
  830.         <font>Palatino</font>
  831.         <textSize>10</textSize>
  832.         <textStyle>plain</textStyle>
  833.         <textHeight>13</textHeight>
  834.         <name></name>
  835.         <script>on mouseUp
  836. visual iris open
  837. get the number of the target
  838. get card field (it-1)
  839. if it is not "" then
  840. go card it
  841. end if
  842. end mouseUp
  843. </script>
  844.     </part>
  845.     <part>
  846.         <id>39</id>
  847.         <type>field</type>
  848.         <visible> <true /> </visible>
  849.         <dontWrap> <false /> </dontWrap>
  850.         <dontSearch> <false /> </dontSearch>
  851.         <sharedText> <false /> </sharedText>
  852.         <fixedLineHeight> <true /> </fixedLineHeight>
  853.         <autoTab> <false /> </autoTab>
  854.         <lockText> <true /> </lockText>
  855.         <rect>
  856.             <left>190</left>
  857.             <top>125</top>
  858.             <right>233</right>
  859.             <bottom>139</bottom>
  860.         </rect>
  861.         <style>transparent</style>
  862.         <autoSelect> <false /> </autoSelect>
  863.         <showLines> <false /> </showLines>
  864.         <wideMargins> <false /> </wideMargins>
  865.         <multipleLines> <false /> </multipleLines>
  866.         <reservedFamily> 0 </reservedFamily>
  867.         <titleWidth>0</titleWidth>
  868.         <icon>0</icon>
  869.         <textAlign>right</textAlign>
  870.         <font>Palatino</font>
  871.         <textSize>10</textSize>
  872.         <textStyle>plain</textStyle>
  873.         <textHeight>13</textHeight>
  874.         <name></name>
  875.         <script></script>
  876.     </part>
  877.     <part>
  878.         <id>38</id>
  879.         <type>field</type>
  880.         <visible> <true /> </visible>
  881.         <dontWrap> <false /> </dontWrap>
  882.         <dontSearch> <false /> </dontSearch>
  883.         <sharedText> <false /> </sharedText>
  884.         <fixedLineHeight> <true /> </fixedLineHeight>
  885.         <autoTab> <false /> </autoTab>
  886.         <lockText> <true /> </lockText>
  887.         <rect>
  888.             <left>14</left>
  889.             <top>125</top>
  890.             <right>233</right>
  891.             <bottom>139</bottom>
  892.         </rect>
  893.         <style>transparent</style>
  894.         <autoSelect> <false /> </autoSelect>
  895.         <showLines> <false /> </showLines>
  896.         <wideMargins> <false /> </wideMargins>
  897.         <multipleLines> <false /> </multipleLines>
  898.         <reservedFamily> 0 </reservedFamily>
  899.         <titleWidth>0</titleWidth>
  900.         <icon>0</icon>
  901.         <textAlign>left</textAlign>
  902.         <font>Palatino</font>
  903.         <textSize>10</textSize>
  904.         <textStyle>plain</textStyle>
  905.         <textHeight>13</textHeight>
  906.         <name></name>
  907.         <script>on mouseUp
  908. visual iris open
  909. get the number of the target
  910. get card field (it-1)
  911. if it is not "" then
  912. go card it
  913. end if
  914. end mouseUp
  915. </script>
  916.     </part>
  917.     <part>
  918.         <id>44</id>
  919.         <type>field</type>
  920.         <visible> <true /> </visible>
  921.         <dontWrap> <false /> </dontWrap>
  922.         <dontSearch> <false /> </dontSearch>
  923.         <sharedText> <false /> </sharedText>
  924.         <fixedLineHeight> <true /> </fixedLineHeight>
  925.         <autoTab> <false /> </autoTab>
  926.         <lockText> <true /> </lockText>
  927.         <rect>
  928.             <left>190</left>
  929.             <top>138</top>
  930.             <right>233</right>
  931.             <bottom>151</bottom>
  932.         </rect>
  933.         <style>transparent</style>
  934.         <autoSelect> <false /> </autoSelect>
  935.         <showLines> <false /> </showLines>
  936.         <wideMargins> <false /> </wideMargins>
  937.         <multipleLines> <false /> </multipleLines>
  938.         <reservedFamily> 0 </reservedFamily>
  939.         <titleWidth>0</titleWidth>
  940.         <icon>0</icon>
  941.         <textAlign>right</textAlign>
  942.         <font>Palatino</font>
  943.         <textSize>10</textSize>
  944.         <textStyle>plain</textStyle>
  945.         <textHeight>13</textHeight>
  946.         <name></name>
  947.         <script></script>
  948.     </part>
  949.     <part>
  950.         <id>43</id>
  951.         <type>field</type>
  952.         <visible> <true /> </visible>
  953.         <dontWrap> <false /> </dontWrap>
  954.         <dontSearch> <false /> </dontSearch>
  955.         <sharedText> <false /> </sharedText>
  956.         <fixedLineHeight> <true /> </fixedLineHeight>
  957.         <autoTab> <false /> </autoTab>
  958.         <lockText> <true /> </lockText>
  959.         <rect>
  960.             <left>14</left>
  961.             <top>138</top>
  962.             <right>233</right>
  963.             <bottom>152</bottom>
  964.         </rect>
  965.         <style>transparent</style>
  966.         <autoSelect> <false /> </autoSelect>
  967.         <showLines> <false /> </showLines>
  968.         <wideMargins> <false /> </wideMargins>
  969.         <multipleLines> <false /> </multipleLines>
  970.         <reservedFamily> 0 </reservedFamily>
  971.         <titleWidth>0</titleWidth>
  972.         <icon>0</icon>
  973.         <textAlign>left</textAlign>
  974.         <font>Palatino</font>
  975.         <textSize>10</textSize>
  976.         <textStyle>plain</textStyle>
  977.         <textHeight>13</textHeight>
  978.         <name></name>
  979.         <script>on mouseUp
  980. visual iris open
  981. get the number of the target
  982. get card field (it-1)
  983. if it is not "" then
  984. go card it
  985. end if
  986. end mouseUp
  987. </script>
  988.     </part>
  989.     <part>
  990.         <id>46</id>
  991.         <type>field</type>
  992.         <visible> <true /> </visible>
  993.         <dontWrap> <false /> </dontWrap>
  994.         <dontSearch> <false /> </dontSearch>
  995.         <sharedText> <false /> </sharedText>
  996.         <fixedLineHeight> <true /> </fixedLineHeight>
  997.         <autoTab> <false /> </autoTab>
  998.         <lockText> <true /> </lockText>
  999.         <rect>
  1000.             <left>190</left>
  1001.             <top>151</top>
  1002.             <right>233</right>
  1003.             <bottom>165</bottom>
  1004.         </rect>
  1005.         <style>transparent</style>
  1006.         <autoSelect> <false /> </autoSelect>
  1007.         <showLines> <false /> </showLines>
  1008.         <wideMargins> <false /> </wideMargins>
  1009.         <multipleLines> <false /> </multipleLines>
  1010.         <reservedFamily> 0 </reservedFamily>
  1011.         <titleWidth>0</titleWidth>
  1012.         <icon>0</icon>
  1013.         <textAlign>right</textAlign>
  1014.         <font>Palatino</font>
  1015.         <textSize>10</textSize>
  1016.         <textStyle>plain</textStyle>
  1017.         <textHeight>13</textHeight>
  1018.         <name></name>
  1019.         <script></script>
  1020.     </part>
  1021.     <part>
  1022.         <id>45</id>
  1023.         <type>field</type>
  1024.         <visible> <true /> </visible>
  1025.         <dontWrap> <false /> </dontWrap>
  1026.         <dontSearch> <false /> </dontSearch>
  1027.         <sharedText> <false /> </sharedText>
  1028.         <fixedLineHeight> <true /> </fixedLineHeight>
  1029.         <autoTab> <false /> </autoTab>
  1030.         <lockText> <true /> </lockText>
  1031.         <rect>
  1032.             <left>14</left>
  1033.             <top>151</top>
  1034.             <right>233</right>
  1035.             <bottom>165</bottom>
  1036.         </rect>
  1037.         <style>transparent</style>
  1038.         <autoSelect> <false /> </autoSelect>
  1039.         <showLines> <false /> </showLines>
  1040.         <wideMargins> <false /> </wideMargins>
  1041.         <multipleLines> <false /> </multipleLines>
  1042.         <reservedFamily> 0 </reservedFamily>
  1043.         <titleWidth>0</titleWidth>
  1044.         <icon>0</icon>
  1045.         <textAlign>left</textAlign>
  1046.         <font>Palatino</font>
  1047.         <textSize>10</textSize>
  1048.         <textStyle>plain</textStyle>
  1049.         <textHeight>13</textHeight>
  1050.         <name></name>
  1051.         <script>on mouseUp
  1052. visual iris open
  1053. get the number of the target
  1054. get card field (it-1)
  1055. if it is not "" then
  1056. go card it
  1057. end if
  1058. end mouseUp
  1059. </script>
  1060.     </part>
  1061.     <part>
  1062.         <id>48</id>
  1063.         <type>field</type>
  1064.         <visible> <true /> </visible>
  1065.         <dontWrap> <false /> </dontWrap>
  1066.         <dontSearch> <false /> </dontSearch>
  1067.         <sharedText> <false /> </sharedText>
  1068.         <fixedLineHeight> <true /> </fixedLineHeight>
  1069.         <autoTab> <false /> </autoTab>
  1070.         <lockText> <true /> </lockText>
  1071.         <rect>
  1072.             <left>190</left>
  1073.             <top>164</top>
  1074.             <right>233</right>
  1075.             <bottom>178</bottom>
  1076.         </rect>
  1077.         <style>transparent</style>
  1078.         <autoSelect> <false /> </autoSelect>
  1079.         <showLines> <false /> </showLines>
  1080.         <wideMargins> <false /> </wideMargins>
  1081.         <multipleLines> <false /> </multipleLines>
  1082.         <reservedFamily> 0 </reservedFamily>
  1083.         <titleWidth>0</titleWidth>
  1084.         <icon>0</icon>
  1085.         <textAlign>right</textAlign>
  1086.         <font>Palatino</font>
  1087.         <textSize>10</textSize>
  1088.         <textStyle>plain</textStyle>
  1089.         <textHeight>13</textHeight>
  1090.         <name></name>
  1091.         <script></script>
  1092.     </part>
  1093.     <part>
  1094.         <id>47</id>
  1095.         <type>field</type>
  1096.         <visible> <true /> </visible>
  1097.         <dontWrap> <false /> </dontWrap>
  1098.         <dontSearch> <false /> </dontSearch>
  1099.         <sharedText> <false /> </sharedText>
  1100.         <fixedLineHeight> <true /> </fixedLineHeight>
  1101.         <autoTab> <false /> </autoTab>
  1102.         <lockText> <true /> </lockText>
  1103.         <rect>
  1104.             <left>14</left>
  1105.             <top>164</top>
  1106.             <right>233</right>
  1107.             <bottom>178</bottom>
  1108.         </rect>
  1109.         <style>transparent</style>
  1110.         <autoSelect> <false /> </autoSelect>
  1111.         <showLines> <false /> </showLines>
  1112.         <wideMargins> <false /> </wideMargins>
  1113.         <multipleLines> <false /> </multipleLines>
  1114.         <reservedFamily> 0 </reservedFamily>
  1115.         <titleWidth>0</titleWidth>
  1116.         <icon>0</icon>
  1117.         <textAlign>left</textAlign>
  1118.         <font>Palatino</font>
  1119.         <textSize>10</textSize>
  1120.         <textStyle>plain</textStyle>
  1121.         <textHeight>13</textHeight>
  1122.         <name></name>
  1123.         <script>on mouseUp
  1124. visual iris open
  1125. get the number of the target
  1126. get card field (it-1)
  1127. if it is not "" then
  1128. go card it
  1129. end if
  1130. end mouseUp
  1131. </script>
  1132.     </part>
  1133.     <part>
  1134.         <id>50</id>
  1135.         <type>field</type>
  1136.         <visible> <true /> </visible>
  1137.         <dontWrap> <false /> </dontWrap>
  1138.         <dontSearch> <false /> </dontSearch>
  1139.         <sharedText> <false /> </sharedText>
  1140.         <fixedLineHeight> <true /> </fixedLineHeight>
  1141.         <autoTab> <false /> </autoTab>
  1142.         <lockText> <true /> </lockText>
  1143.         <rect>
  1144.             <left>190</left>
  1145.             <top>177</top>
  1146.             <right>233</right>
  1147.             <bottom>191</bottom>
  1148.         </rect>
  1149.         <style>transparent</style>
  1150.         <autoSelect> <false /> </autoSelect>
  1151.         <showLines> <false /> </showLines>
  1152.         <wideMargins> <false /> </wideMargins>
  1153.         <multipleLines> <false /> </multipleLines>
  1154.         <reservedFamily> 0 </reservedFamily>
  1155.         <titleWidth>0</titleWidth>
  1156.         <icon>0</icon>
  1157.         <textAlign>right</textAlign>
  1158.         <font>Palatino</font>
  1159.         <textSize>10</textSize>
  1160.         <textStyle>plain</textStyle>
  1161.         <textHeight>13</textHeight>
  1162.         <name></name>
  1163.         <script></script>
  1164.     </part>
  1165.     <part>
  1166.         <id>49</id>
  1167.         <type>field</type>
  1168.         <visible> <true /> </visible>
  1169.         <dontWrap> <false /> </dontWrap>
  1170.         <dontSearch> <false /> </dontSearch>
  1171.         <sharedText> <false /> </sharedText>
  1172.         <fixedLineHeight> <true /> </fixedLineHeight>
  1173.         <autoTab> <false /> </autoTab>
  1174.         <lockText> <true /> </lockText>
  1175.         <rect>
  1176.             <left>14</left>
  1177.             <top>177</top>
  1178.             <right>233</right>
  1179.             <bottom>191</bottom>
  1180.         </rect>
  1181.         <style>transparent</style>
  1182.         <autoSelect> <false /> </autoSelect>
  1183.         <showLines> <false /> </showLines>
  1184.         <wideMargins> <false /> </wideMargins>
  1185.         <multipleLines> <false /> </multipleLines>
  1186.         <reservedFamily> 0 </reservedFamily>
  1187.         <titleWidth>0</titleWidth>
  1188.         <icon>0</icon>
  1189.         <textAlign>left</textAlign>
  1190.         <font>Palatino</font>
  1191.         <textSize>10</textSize>
  1192.         <textStyle>plain</textStyle>
  1193.         <textHeight>13</textHeight>
  1194.         <name></name>
  1195.         <script>on mouseUp
  1196. visual iris open
  1197. get the number of the target
  1198. get card field (it-1)
  1199. if it is not "" then
  1200. go card it
  1201. end if
  1202. end mouseUp
  1203. </script>
  1204.     </part>
  1205.     <part>
  1206.         <id>52</id>
  1207.         <type>field</type>
  1208.         <visible> <true /> </visible>
  1209.         <dontWrap> <false /> </dontWrap>
  1210.         <dontSearch> <false /> </dontSearch>
  1211.         <sharedText> <false /> </sharedText>
  1212.         <fixedLineHeight> <true /> </fixedLineHeight>
  1213.         <autoTab> <false /> </autoTab>
  1214.         <lockText> <true /> </lockText>
  1215.         <rect>
  1216.             <left>190</left>
  1217.             <top>190</top>
  1218.             <right>233</right>
  1219.             <bottom>203</bottom>
  1220.         </rect>
  1221.         <style>transparent</style>
  1222.         <autoSelect> <false /> </autoSelect>
  1223.         <showLines> <false /> </showLines>
  1224.         <wideMargins> <false /> </wideMargins>
  1225.         <multipleLines> <false /> </multipleLines>
  1226.         <reservedFamily> 0 </reservedFamily>
  1227.         <titleWidth>0</titleWidth>
  1228.         <icon>0</icon>
  1229.         <textAlign>right</textAlign>
  1230.         <font>Palatino</font>
  1231.         <textSize>10</textSize>
  1232.         <textStyle>plain</textStyle>
  1233.         <textHeight>13</textHeight>
  1234.         <name></name>
  1235.         <script></script>
  1236.     </part>
  1237.     <part>
  1238.         <id>51</id>
  1239.         <type>field</type>
  1240.         <visible> <true /> </visible>
  1241.         <dontWrap> <false /> </dontWrap>
  1242.         <dontSearch> <false /> </dontSearch>
  1243.         <sharedText> <false /> </sharedText>
  1244.         <fixedLineHeight> <true /> </fixedLineHeight>
  1245.         <autoTab> <false /> </autoTab>
  1246.         <lockText> <true /> </lockText>
  1247.         <rect>
  1248.             <left>14</left>
  1249.             <top>190</top>
  1250.             <right>233</right>
  1251.             <bottom>204</bottom>
  1252.         </rect>
  1253.         <style>transparent</style>
  1254.         <autoSelect> <false /> </autoSelect>
  1255.         <showLines> <false /> </showLines>
  1256.         <wideMargins> <false /> </wideMargins>
  1257.         <multipleLines> <false /> </multipleLines>
  1258.         <reservedFamily> 0 </reservedFamily>
  1259.         <titleWidth>0</titleWidth>
  1260.         <icon>0</icon>
  1261.         <textAlign>left</textAlign>
  1262.         <font>Palatino</font>
  1263.         <textSize>10</textSize>
  1264.         <textStyle>plain</textStyle>
  1265.         <textHeight>13</textHeight>
  1266.         <name></name>
  1267.         <script>on mouseUp
  1268. visual iris open
  1269. get the number of the target
  1270. get card field (it-1)
  1271. if it is not "" then
  1272. go card it
  1273. end if
  1274. end mouseUp
  1275. </script>
  1276.     </part>
  1277.     <part>
  1278.         <id>54</id>
  1279.         <type>field</type>
  1280.         <visible> <true /> </visible>
  1281.         <dontWrap> <false /> </dontWrap>
  1282.         <dontSearch> <false /> </dontSearch>
  1283.         <sharedText> <false /> </sharedText>
  1284.         <fixedLineHeight> <true /> </fixedLineHeight>
  1285.         <autoTab> <false /> </autoTab>
  1286.         <lockText> <true /> </lockText>
  1287.         <rect>
  1288.             <left>190</left>
  1289.             <top>203</top>
  1290.             <right>233</right>
  1291.             <bottom>217</bottom>
  1292.         </rect>
  1293.         <style>transparent</style>
  1294.         <autoSelect> <false /> </autoSelect>
  1295.         <showLines> <false /> </showLines>
  1296.         <wideMargins> <false /> </wideMargins>
  1297.         <multipleLines> <false /> </multipleLines>
  1298.         <reservedFamily> 0 </reservedFamily>
  1299.         <titleWidth>0</titleWidth>
  1300.         <icon>0</icon>
  1301.         <textAlign>right</textAlign>
  1302.         <font>Palatino</font>
  1303.         <textSize>10</textSize>
  1304.         <textStyle>plain</textStyle>
  1305.         <textHeight>13</textHeight>
  1306.         <name></name>
  1307.         <script></script>
  1308.     </part>
  1309.     <part>
  1310.         <id>53</id>
  1311.         <type>field</type>
  1312.         <visible> <true /> </visible>
  1313.         <dontWrap> <false /> </dontWrap>
  1314.         <dontSearch> <false /> </dontSearch>
  1315.         <sharedText> <false /> </sharedText>
  1316.         <fixedLineHeight> <true /> </fixedLineHeight>
  1317.         <autoTab> <false /> </autoTab>
  1318.         <lockText> <true /> </lockText>
  1319.         <rect>
  1320.             <left>14</left>
  1321.             <top>203</top>
  1322.             <right>233</right>
  1323.             <bottom>217</bottom>
  1324.         </rect>
  1325.         <style>transparent</style>
  1326.         <autoSelect> <false /> </autoSelect>
  1327.         <showLines> <false /> </showLines>
  1328.         <wideMargins> <false /> </wideMargins>
  1329.         <multipleLines> <false /> </multipleLines>
  1330.         <reservedFamily> 0 </reservedFamily>
  1331.         <titleWidth>0</titleWidth>
  1332.         <icon>0</icon>
  1333.         <textAlign>left</textAlign>
  1334.         <font>Palatino</font>
  1335.         <textSize>10</textSize>
  1336.         <textStyle>plain</textStyle>
  1337.         <textHeight>13</textHeight>
  1338.         <name></name>
  1339.         <script>on mouseUp
  1340. visual iris open
  1341. get the number of the target
  1342. get card field (it-1)
  1343. if it is not "" then
  1344. go card it
  1345. end if
  1346. end mouseUp
  1347. </script>
  1348.     </part>
  1349.     <part>
  1350.         <id>56</id>
  1351.         <type>field</type>
  1352.         <visible> <true /> </visible>
  1353.         <dontWrap> <false /> </dontWrap>
  1354.         <dontSearch> <false /> </dontSearch>
  1355.         <sharedText> <false /> </sharedText>
  1356.         <fixedLineHeight> <true /> </fixedLineHeight>
  1357.         <autoTab> <false /> </autoTab>
  1358.         <lockText> <true /> </lockText>
  1359.         <rect>
  1360.             <left>190</left>
  1361.             <top>216</top>
  1362.             <right>233</right>
  1363.             <bottom>230</bottom>
  1364.         </rect>
  1365.         <style>transparent</style>
  1366.         <autoSelect> <false /> </autoSelect>
  1367.         <showLines> <false /> </showLines>
  1368.         <wideMargins> <false /> </wideMargins>
  1369.         <multipleLines> <false /> </multipleLines>
  1370.         <reservedFamily> 0 </reservedFamily>
  1371.         <titleWidth>0</titleWidth>
  1372.         <icon>0</icon>
  1373.         <textAlign>right</textAlign>
  1374.         <font>Palatino</font>
  1375.         <textSize>10</textSize>
  1376.         <textStyle>plain</textStyle>
  1377.         <textHeight>13</textHeight>
  1378.         <name></name>
  1379.         <script></script>
  1380.     </part>
  1381.     <part>
  1382.         <id>55</id>
  1383.         <type>field</type>
  1384.         <visible> <true /> </visible>
  1385.         <dontWrap> <false /> </dontWrap>
  1386.         <dontSearch> <false /> </dontSearch>
  1387.         <sharedText> <false /> </sharedText>
  1388.         <fixedLineHeight> <true /> </fixedLineHeight>
  1389.         <autoTab> <false /> </autoTab>
  1390.         <lockText> <true /> </lockText>
  1391.         <rect>
  1392.             <left>14</left>
  1393.             <top>216</top>
  1394.             <right>233</right>
  1395.             <bottom>230</bottom>
  1396.         </rect>
  1397.         <style>transparent</style>
  1398.         <autoSelect> <false /> </autoSelect>
  1399.         <showLines> <false /> </showLines>
  1400.         <wideMargins> <false /> </wideMargins>
  1401.         <multipleLines> <false /> </multipleLines>
  1402.         <reservedFamily> 0 </reservedFamily>
  1403.         <titleWidth>0</titleWidth>
  1404.         <icon>0</icon>
  1405.         <textAlign>left</textAlign>
  1406.         <font>Palatino</font>
  1407.         <textSize>10</textSize>
  1408.         <textStyle>plain</textStyle>
  1409.         <textHeight>13</textHeight>
  1410.         <name></name>
  1411.         <script>on mouseUp
  1412. visual iris open
  1413. get the number of the target
  1414. get card field (it-1)
  1415. if it is not "" then
  1416. go card it
  1417. end if
  1418. end mouseUp
  1419. </script>
  1420.     </part>
  1421.     <part>
  1422.         <id>58</id>
  1423.         <type>field</type>
  1424.         <visible> <true /> </visible>
  1425.         <dontWrap> <false /> </dontWrap>
  1426.         <dontSearch> <false /> </dontSearch>
  1427.         <sharedText> <false /> </sharedText>
  1428.         <fixedLineHeight> <true /> </fixedLineHeight>
  1429.         <autoTab> <false /> </autoTab>
  1430.         <lockText> <true /> </lockText>
  1431.         <rect>
  1432.             <left>190</left>
  1433.             <top>229</top>
  1434.             <right>233</right>
  1435.             <bottom>243</bottom>
  1436.         </rect>
  1437.         <style>transparent</style>
  1438.         <autoSelect> <false /> </autoSelect>
  1439.         <showLines> <false /> </showLines>
  1440.         <wideMargins> <false /> </wideMargins>
  1441.         <multipleLines> <false /> </multipleLines>
  1442.         <reservedFamily> 0 </reservedFamily>
  1443.         <titleWidth>0</titleWidth>
  1444.         <icon>0</icon>
  1445.         <textAlign>right</textAlign>
  1446.         <font>Palatino</font>
  1447.         <textSize>10</textSize>
  1448.         <textStyle>plain</textStyle>
  1449.         <textHeight>13</textHeight>
  1450.         <name></name>
  1451.         <script></script>
  1452.     </part>
  1453.     <part>
  1454.         <id>57</id>
  1455.         <type>field</type>
  1456.         <visible> <true /> </visible>
  1457.         <dontWrap> <false /> </dontWrap>
  1458.         <dontSearch> <false /> </dontSearch>
  1459.         <sharedText> <false /> </sharedText>
  1460.         <fixedLineHeight> <true /> </fixedLineHeight>
  1461.         <autoTab> <false /> </autoTab>
  1462.         <lockText> <true /> </lockText>
  1463.         <rect>
  1464.             <left>14</left>
  1465.             <top>229</top>
  1466.             <right>233</right>
  1467.             <bottom>243</bottom>
  1468.         </rect>
  1469.         <style>transparent</style>
  1470.         <autoSelect> <false /> </autoSelect>
  1471.         <showLines> <false /> </showLines>
  1472.         <wideMargins> <false /> </wideMargins>
  1473.         <multipleLines> <false /> </multipleLines>
  1474.         <reservedFamily> 0 </reservedFamily>
  1475.         <titleWidth>0</titleWidth>
  1476.         <icon>0</icon>
  1477.         <textAlign>left</textAlign>
  1478.         <font>Palatino</font>
  1479.         <textSize>10</textSize>
  1480.         <textStyle>plain</textStyle>
  1481.         <textHeight>13</textHeight>
  1482.         <name></name>
  1483.         <script>on mouseUp
  1484. visual iris open
  1485. get the number of the target
  1486. get card field (it-1)
  1487. if it is not "" then
  1488. go card it
  1489. end if
  1490. end mouseUp
  1491. </script>
  1492.     </part>
  1493.     <part>
  1494.         <id>60</id>
  1495.         <type>field</type>
  1496.         <visible> <true /> </visible>
  1497.         <dontWrap> <false /> </dontWrap>
  1498.         <dontSearch> <false /> </dontSearch>
  1499.         <sharedText> <false /> </sharedText>
  1500.         <fixedLineHeight> <true /> </fixedLineHeight>
  1501.         <autoTab> <false /> </autoTab>
  1502.         <lockText> <true /> </lockText>
  1503.         <rect>
  1504.             <left>190</left>
  1505.             <top>242</top>
  1506.             <right>233</right>
  1507.             <bottom>255</bottom>
  1508.         </rect>
  1509.         <style>transparent</style>
  1510.         <autoSelect> <false /> </autoSelect>
  1511.         <showLines> <false /> </showLines>
  1512.         <wideMargins> <false /> </wideMargins>
  1513.         <multipleLines> <false /> </multipleLines>
  1514.         <reservedFamily> 0 </reservedFamily>
  1515.         <titleWidth>0</titleWidth>
  1516.         <icon>0</icon>
  1517.         <textAlign>right</textAlign>
  1518.         <font>Palatino</font>
  1519.         <textSize>10</textSize>
  1520.         <textStyle>plain</textStyle>
  1521.         <textHeight>13</textHeight>
  1522.         <name></name>
  1523.         <script></script>
  1524.     </part>
  1525.     <part>
  1526.         <id>59</id>
  1527.         <type>field</type>
  1528.         <visible> <true /> </visible>
  1529.         <dontWrap> <false /> </dontWrap>
  1530.         <dontSearch> <false /> </dontSearch>
  1531.         <sharedText> <false /> </sharedText>
  1532.         <fixedLineHeight> <true /> </fixedLineHeight>
  1533.         <autoTab> <false /> </autoTab>
  1534.         <lockText> <true /> </lockText>
  1535.         <rect>
  1536.             <left>14</left>
  1537.             <top>242</top>
  1538.             <right>233</right>
  1539.             <bottom>256</bottom>
  1540.         </rect>
  1541.         <style>transparent</style>
  1542.         <autoSelect> <false /> </autoSelect>
  1543.         <showLines> <false /> </showLines>
  1544.         <wideMargins> <false /> </wideMargins>
  1545.         <multipleLines> <false /> </multipleLines>
  1546.         <reservedFamily> 0 </reservedFamily>
  1547.         <titleWidth>0</titleWidth>
  1548.         <icon>0</icon>
  1549.         <textAlign>left</textAlign>
  1550.         <font>Palatino</font>
  1551.         <textSize>10</textSize>
  1552.         <textStyle>plain</textStyle>
  1553.         <textHeight>13</textHeight>
  1554.         <name></name>
  1555.         <script>on mouseUp
  1556. visual iris open
  1557. get the number of the target
  1558. get card field (it-1)
  1559. if it is not "" then
  1560. go card it
  1561. end if
  1562. end mouseUp
  1563. </script>
  1564.     </part>
  1565.     <part>
  1566.         <id>62</id>
  1567.         <type>field</type>
  1568.         <visible> <true /> </visible>
  1569.         <dontWrap> <false /> </dontWrap>
  1570.         <dontSearch> <false /> </dontSearch>
  1571.         <sharedText> <false /> </sharedText>
  1572.         <fixedLineHeight> <true /> </fixedLineHeight>
  1573.         <autoTab> <false /> </autoTab>
  1574.         <lockText> <true /> </lockText>
  1575.         <rect>
  1576.             <left>190</left>
  1577.             <top>255</top>
  1578.             <right>233</right>
  1579.             <bottom>268</bottom>
  1580.         </rect>
  1581.         <style>transparent</style>
  1582.         <autoSelect> <false /> </autoSelect>
  1583.         <showLines> <false /> </showLines>
  1584.         <wideMargins> <false /> </wideMargins>
  1585.         <multipleLines> <false /> </multipleLines>
  1586.         <reservedFamily> 0 </reservedFamily>
  1587.         <titleWidth>0</titleWidth>
  1588.         <icon>0</icon>
  1589.         <textAlign>right</textAlign>
  1590.         <font>Palatino</font>
  1591.         <textSize>10</textSize>
  1592.         <textStyle>plain</textStyle>
  1593.         <textHeight>13</textHeight>
  1594.         <name></name>
  1595.         <script></script>
  1596.     </part>
  1597.     <part>
  1598.         <id>61</id>
  1599.         <type>field</type>
  1600.         <visible> <true /> </visible>
  1601.         <dontWrap> <false /> </dontWrap>
  1602.         <dontSearch> <false /> </dontSearch>
  1603.         <sharedText> <false /> </sharedText>
  1604.         <fixedLineHeight> <true /> </fixedLineHeight>
  1605.         <autoTab> <false /> </autoTab>
  1606.         <lockText> <true /> </lockText>
  1607.         <rect>
  1608.             <left>14</left>
  1609.             <top>255</top>
  1610.             <right>233</right>
  1611.             <bottom>269</bottom>
  1612.         </rect>
  1613.         <style>transparent</style>
  1614.         <autoSelect> <false /> </autoSelect>
  1615.         <showLines> <false /> </showLines>
  1616.         <wideMargins> <false /> </wideMargins>
  1617.         <multipleLines> <false /> </multipleLines>
  1618.         <reservedFamily> 0 </reservedFamily>
  1619.         <titleWidth>0</titleWidth>
  1620.         <icon>0</icon>
  1621.         <textAlign>left</textAlign>
  1622.         <font>Palatino</font>
  1623.         <textSize>10</textSize>
  1624.         <textStyle>plain</textStyle>
  1625.         <textHeight>13</textHeight>
  1626.         <name></name>
  1627.         <script>on mouseUp
  1628. visual iris open
  1629. get the number of the target
  1630. get card field (it-1)
  1631. if it is not "" then
  1632. go card it
  1633. end if
  1634. end mouseUp
  1635. </script>
  1636.     </part>
  1637.     <part>
  1638.         <id>64</id>
  1639.         <type>field</type>
  1640.         <visible> <true /> </visible>
  1641.         <dontWrap> <false /> </dontWrap>
  1642.         <dontSearch> <false /> </dontSearch>
  1643.         <sharedText> <false /> </sharedText>
  1644.         <fixedLineHeight> <true /> </fixedLineHeight>
  1645.         <autoTab> <false /> </autoTab>
  1646.         <lockText> <true /> </lockText>
  1647.         <rect>
  1648.             <left>190</left>
  1649.             <top>268</top>
  1650.             <right>233</right>
  1651.             <bottom>282</bottom>
  1652.         </rect>
  1653.         <style>transparent</style>
  1654.         <autoSelect> <false /> </autoSelect>
  1655.         <showLines> <false /> </showLines>
  1656.         <wideMargins> <false /> </wideMargins>
  1657.         <multipleLines> <false /> </multipleLines>
  1658.         <reservedFamily> 0 </reservedFamily>
  1659.         <titleWidth>0</titleWidth>
  1660.         <icon>0</icon>
  1661.         <textAlign>right</textAlign>
  1662.         <font>Palatino</font>
  1663.         <textSize>10</textSize>
  1664.         <textStyle>plain</textStyle>
  1665.         <textHeight>13</textHeight>
  1666.         <name></name>
  1667.         <script></script>
  1668.     </part>
  1669.     <part>
  1670.         <id>63</id>
  1671.         <type>field</type>
  1672.         <visible> <true /> </visible>
  1673.         <dontWrap> <false /> </dontWrap>
  1674.         <dontSearch> <false /> </dontSearch>
  1675.         <sharedText> <false /> </sharedText>
  1676.         <fixedLineHeight> <true /> </fixedLineHeight>
  1677.         <autoTab> <false /> </autoTab>
  1678.         <lockText> <true /> </lockText>
  1679.         <rect>
  1680.             <left>14</left>
  1681.             <top>268</top>
  1682.             <right>233</right>
  1683.             <bottom>282</bottom>
  1684.         </rect>
  1685.         <style>transparent</style>
  1686.         <autoSelect> <false /> </autoSelect>
  1687.         <showLines> <false /> </showLines>
  1688.         <wideMargins> <false /> </wideMargins>
  1689.         <multipleLines> <false /> </multipleLines>
  1690.         <reservedFamily> 0 </reservedFamily>
  1691.         <titleWidth>0</titleWidth>
  1692.         <icon>0</icon>
  1693.         <textAlign>left</textAlign>
  1694.         <font>Palatino</font>
  1695.         <textSize>10</textSize>
  1696.         <textStyle>plain</textStyle>
  1697.         <textHeight>13</textHeight>
  1698.         <name></name>
  1699.         <script>on mouseUp
  1700. visual iris open
  1701. get the number of the target
  1702. get card field (it-1)
  1703. if it is not "" then
  1704. go card it
  1705. end if
  1706. end mouseUp
  1707. </script>
  1708.     </part>
  1709.     <part>
  1710.         <id>66</id>
  1711.         <type>field</type>
  1712.         <visible> <true /> </visible>
  1713.         <dontWrap> <false /> </dontWrap>
  1714.         <dontSearch> <false /> </dontSearch>
  1715.         <sharedText> <false /> </sharedText>
  1716.         <fixedLineHeight> <true /> </fixedLineHeight>
  1717.         <autoTab> <false /> </autoTab>
  1718.         <lockText> <true /> </lockText>
  1719.         <rect>
  1720.             <left>190</left>
  1721.             <top>281</top>
  1722.             <right>233</right>
  1723.             <bottom>295</bottom>
  1724.         </rect>
  1725.         <style>transparent</style>
  1726.         <autoSelect> <false /> </autoSelect>
  1727.         <showLines> <false /> </showLines>
  1728.         <wideMargins> <false /> </wideMargins>
  1729.         <multipleLines> <false /> </multipleLines>
  1730.         <reservedFamily> 0 </reservedFamily>
  1731.         <titleWidth>0</titleWidth>
  1732.         <icon>0</icon>
  1733.         <textAlign>right</textAlign>
  1734.         <font>Palatino</font>
  1735.         <textSize>10</textSize>
  1736.         <textStyle>plain</textStyle>
  1737.         <textHeight>13</textHeight>
  1738.         <name></name>
  1739.         <script></script>
  1740.     </part>
  1741.     <part>
  1742.         <id>65</id>
  1743.         <type>field</type>
  1744.         <visible> <true /> </visible>
  1745.         <dontWrap> <false /> </dontWrap>
  1746.         <dontSearch> <false /> </dontSearch>
  1747.         <sharedText> <false /> </sharedText>
  1748.         <fixedLineHeight> <true /> </fixedLineHeight>
  1749.         <autoTab> <false /> </autoTab>
  1750.         <lockText> <true /> </lockText>
  1751.         <rect>
  1752.             <left>14</left>
  1753.             <top>281</top>
  1754.             <right>233</right>
  1755.             <bottom>295</bottom>
  1756.         </rect>
  1757.         <style>transparent</style>
  1758.         <autoSelect> <false /> </autoSelect>
  1759.         <showLines> <false /> </showLines>
  1760.         <wideMargins> <false /> </wideMargins>
  1761.         <multipleLines> <false /> </multipleLines>
  1762.         <reservedFamily> 0 </reservedFamily>
  1763.         <titleWidth>0</titleWidth>
  1764.         <icon>0</icon>
  1765.         <textAlign>left</textAlign>
  1766.         <font>Palatino</font>
  1767.         <textSize>10</textSize>
  1768.         <textStyle>plain</textStyle>
  1769.         <textHeight>13</textHeight>
  1770.         <name></name>
  1771.         <script>on mouseUp
  1772. visual iris open
  1773. get the number of the target
  1774. get card field (it-1)
  1775. if it is not "" then
  1776. go card it
  1777. end if
  1778. end mouseUp
  1779. </script>
  1780.     </part>
  1781.     <part>
  1782.         <id>67</id>
  1783.         <type>button</type>
  1784.         <visible> <false /> </visible>
  1785.         <reserved5> 0 </reserved5>
  1786.         <reserved4> 0 </reserved4>
  1787.         <reserved3> 0 </reserved3>
  1788.         <reserved2> 0 </reserved2>
  1789.         <reserved1> 0 </reserved1>
  1790.         <enabled> <true /> </enabled>
  1791.         <rect>
  1792.             <left>364</left>
  1793.             <top>26</top>
  1794.             <right>466</right>
  1795.             <bottom>43</bottom>
  1796.         </rect>
  1797.         <style>roundrect</style>
  1798.         <showName> <true /> </showName>
  1799.         <highlight> <false /> </highlight>
  1800.         <autoHighlight> <true /> </autoHighlight>
  1801.         <sharedHighlight> <true /> </sharedHighlight>
  1802.         <family>0</family>
  1803.         <titleWidth>0</titleWidth>
  1804.         <icon>0</icon>
  1805.         <textAlign>center</textAlign>
  1806.         <font>Chicago</font>
  1807.         <textSize>12</textSize>
  1808.         <textStyle>plain</textStyle>
  1809.         <name>Add Topic</name>
  1810.         <script>on mouseUp
  1811. show card button "beep"
  1812. show card button "Enter ID of desired card"
  1813. show card field "content list"
  1814. hide card button "Add Topic"
  1815. show card button "Done Changes"
  1816. end mouseUp
  1817. </script>
  1818.     </part>
  1819.     <part>
  1820.         <id>84</id>
  1821.         <type>field</type>
  1822.         <visible> <true /> </visible>
  1823.         <dontWrap> <false /> </dontWrap>
  1824.         <dontSearch> <false /> </dontSearch>
  1825.         <sharedText> <false /> </sharedText>
  1826.         <fixedLineHeight> <true /> </fixedLineHeight>
  1827.         <autoTab> <false /> </autoTab>
  1828.         <lockText> <true /> </lockText>
  1829.         <rect>
  1830.             <left>451</left>
  1831.             <top>60</top>
  1832.             <right>494</right>
  1833.             <bottom>74</bottom>
  1834.         </rect>
  1835.         <style>transparent</style>
  1836.         <autoSelect> <false /> </autoSelect>
  1837.         <showLines> <false /> </showLines>
  1838.         <wideMargins> <false /> </wideMargins>
  1839.         <multipleLines> <false /> </multipleLines>
  1840.         <reservedFamily> 0 </reservedFamily>
  1841.         <titleWidth>0</titleWidth>
  1842.         <icon>0</icon>
  1843.         <textAlign>right</textAlign>
  1844.         <font>Palatino</font>
  1845.         <textSize>10</textSize>
  1846.         <textStyle>plain</textStyle>
  1847.         <textHeight>13</textHeight>
  1848.         <name></name>
  1849.         <script></script>
  1850.     </part>
  1851.     <part>
  1852.         <id>85</id>
  1853.         <type>field</type>
  1854.         <visible> <true /> </visible>
  1855.         <dontWrap> <false /> </dontWrap>
  1856.         <dontSearch> <false /> </dontSearch>
  1857.         <sharedText> <false /> </sharedText>
  1858.         <fixedLineHeight> <true /> </fixedLineHeight>
  1859.         <autoTab> <false /> </autoTab>
  1860.         <lockText> <true /> </lockText>
  1861.         <rect>
  1862.             <left>275</left>
  1863.             <top>60</top>
  1864.             <right>494</right>
  1865.             <bottom>74</bottom>
  1866.         </rect>
  1867.         <style>transparent</style>
  1868.         <autoSelect> <false /> </autoSelect>
  1869.         <showLines> <false /> </showLines>
  1870.         <wideMargins> <false /> </wideMargins>
  1871.         <multipleLines> <false /> </multipleLines>
  1872.         <reservedFamily> 0 </reservedFamily>
  1873.         <titleWidth>0</titleWidth>
  1874.         <icon>0</icon>
  1875.         <textAlign>left</textAlign>
  1876.         <font>Palatino</font>
  1877.         <textSize>10</textSize>
  1878.         <textStyle>plain</textStyle>
  1879.         <textHeight>13</textHeight>
  1880.         <name></name>
  1881.         <script>on mouseUp
  1882. visual iris open
  1883. get the number of the target
  1884. get card field (it-1)
  1885. if it is not "" then
  1886. go card it
  1887. end if
  1888. end mouseUp
  1889. </script>
  1890.     </part>
  1891.     <part>
  1892.         <id>90</id>
  1893.         <type>field</type>
  1894.         <visible> <true /> </visible>
  1895.         <dontWrap> <false /> </dontWrap>
  1896.         <dontSearch> <false /> </dontSearch>
  1897.         <sharedText> <false /> </sharedText>
  1898.         <fixedLineHeight> <true /> </fixedLineHeight>
  1899.         <autoTab> <false /> </autoTab>
  1900.         <lockText> <true /> </lockText>
  1901.         <rect>
  1902.             <left>451</left>
  1903.             <top>73</top>
  1904.             <right>494</right>
  1905.             <bottom>87</bottom>
  1906.         </rect>
  1907.         <style>transparent</style>
  1908.         <autoSelect> <false /> </autoSelect>
  1909.         <showLines> <false /> </showLines>
  1910.         <wideMargins> <false /> </wideMargins>
  1911.         <multipleLines> <false /> </multipleLines>
  1912.         <reservedFamily> 0 </reservedFamily>
  1913.         <titleWidth>0</titleWidth>
  1914.         <icon>0</icon>
  1915.         <textAlign>right</textAlign>
  1916.         <font>Palatino</font>
  1917.         <textSize>10</textSize>
  1918.         <textStyle>plain</textStyle>
  1919.         <textHeight>13</textHeight>
  1920.         <name></name>
  1921.         <script></script>
  1922.     </part>
  1923.     <part>
  1924.         <id>89</id>
  1925.         <type>field</type>
  1926.         <visible> <true /> </visible>
  1927.         <dontWrap> <false /> </dontWrap>
  1928.         <dontSearch> <false /> </dontSearch>
  1929.         <sharedText> <false /> </sharedText>
  1930.         <fixedLineHeight> <true /> </fixedLineHeight>
  1931.         <autoTab> <false /> </autoTab>
  1932.         <lockText> <true /> </lockText>
  1933.         <rect>
  1934.             <left>275</left>
  1935.             <top>73</top>
  1936.             <right>494</right>
  1937.             <bottom>87</bottom>
  1938.         </rect>
  1939.         <style>transparent</style>
  1940.         <autoSelect> <false /> </autoSelect>
  1941.         <showLines> <false /> </showLines>
  1942.         <wideMargins> <false /> </wideMargins>
  1943.         <multipleLines> <false /> </multipleLines>
  1944.         <reservedFamily> 0 </reservedFamily>
  1945.         <titleWidth>0</titleWidth>
  1946.         <icon>0</icon>
  1947.         <textAlign>left</textAlign>
  1948.         <font>Palatino</font>
  1949.         <textSize>10</textSize>
  1950.         <textStyle>plain</textStyle>
  1951.         <textHeight>13</textHeight>
  1952.         <name></name>
  1953.         <script>on mouseUp
  1954. visual iris open
  1955. get the number of the target
  1956. get card field (it-1)
  1957. if it is not "" then
  1958. go card it
  1959. end if
  1960. end mouseUp
  1961. </script>
  1962.     </part>
  1963.     <part>
  1964.         <id>92</id>
  1965.         <type>field</type>
  1966.         <visible> <true /> </visible>
  1967.         <dontWrap> <false /> </dontWrap>
  1968.         <dontSearch> <false /> </dontSearch>
  1969.         <sharedText> <false /> </sharedText>
  1970.         <fixedLineHeight> <true /> </fixedLineHeight>
  1971.         <autoTab> <false /> </autoTab>
  1972.         <lockText> <true /> </lockText>
  1973.         <rect>
  1974.             <left>451</left>
  1975.             <top>86</top>
  1976.             <right>494</right>
  1977.             <bottom>100</bottom>
  1978.         </rect>
  1979.         <style>transparent</style>
  1980.         <autoSelect> <false /> </autoSelect>
  1981.         <showLines> <false /> </showLines>
  1982.         <wideMargins> <false /> </wideMargins>
  1983.         <multipleLines> <false /> </multipleLines>
  1984.         <reservedFamily> 0 </reservedFamily>
  1985.         <titleWidth>0</titleWidth>
  1986.         <icon>0</icon>
  1987.         <textAlign>right</textAlign>
  1988.         <font>Palatino</font>
  1989.         <textSize>10</textSize>
  1990.         <textStyle>plain</textStyle>
  1991.         <textHeight>13</textHeight>
  1992.         <name></name>
  1993.         <script></script>
  1994.     </part>
  1995.     <part>
  1996.         <id>91</id>
  1997.         <type>field</type>
  1998.         <visible> <true /> </visible>
  1999.         <dontWrap> <false /> </dontWrap>
  2000.         <dontSearch> <false /> </dontSearch>
  2001.         <sharedText> <false /> </sharedText>
  2002.         <fixedLineHeight> <true /> </fixedLineHeight>
  2003.         <autoTab> <false /> </autoTab>
  2004.         <lockText> <true /> </lockText>
  2005.         <rect>
  2006.             <left>275</left>
  2007.             <top>86</top>
  2008.             <right>494</right>
  2009.             <bottom>100</bottom>
  2010.         </rect>
  2011.         <style>transparent</style>
  2012.         <autoSelect> <false /> </autoSelect>
  2013.         <showLines> <false /> </showLines>
  2014.         <wideMargins> <false /> </wideMargins>
  2015.         <multipleLines> <false /> </multipleLines>
  2016.         <reservedFamily> 0 </reservedFamily>
  2017.         <titleWidth>0</titleWidth>
  2018.         <icon>0</icon>
  2019.         <textAlign>left</textAlign>
  2020.         <font>Palatino</font>
  2021.         <textSize>10</textSize>
  2022.         <textStyle>plain</textStyle>
  2023.         <textHeight>13</textHeight>
  2024.         <name></name>
  2025.         <script>on mouseUp
  2026. visual iris open
  2027. get the number of the target
  2028. get card field (it-1)
  2029. if it is not "" then
  2030. go card it
  2031. end if
  2032. end mouseUp
  2033. </script>
  2034.     </part>
  2035.     <part>
  2036.         <id>94</id>
  2037.         <type>field</type>
  2038.         <visible> <true /> </visible>
  2039.         <dontWrap> <false /> </dontWrap>
  2040.         <dontSearch> <false /> </dontSearch>
  2041.         <sharedText> <false /> </sharedText>
  2042.         <fixedLineHeight> <true /> </fixedLineHeight>
  2043.         <autoTab> <false /> </autoTab>
  2044.         <lockText> <true /> </lockText>
  2045.         <rect>
  2046.             <left>451</left>
  2047.             <top>99</top>
  2048.             <right>494</right>
  2049.             <bottom>113</bottom>
  2050.         </rect>
  2051.         <style>transparent</style>
  2052.         <autoSelect> <false /> </autoSelect>
  2053.         <showLines> <false /> </showLines>
  2054.         <wideMargins> <false /> </wideMargins>
  2055.         <multipleLines> <false /> </multipleLines>
  2056.         <reservedFamily> 0 </reservedFamily>
  2057.         <titleWidth>0</titleWidth>
  2058.         <icon>0</icon>
  2059.         <textAlign>right</textAlign>
  2060.         <font>Palatino</font>
  2061.         <textSize>10</textSize>
  2062.         <textStyle>plain</textStyle>
  2063.         <textHeight>13</textHeight>
  2064.         <name></name>
  2065.         <script></script>
  2066.     </part>
  2067.     <part>
  2068.         <id>93</id>
  2069.         <type>field</type>
  2070.         <visible> <true /> </visible>
  2071.         <dontWrap> <false /> </dontWrap>
  2072.         <dontSearch> <false /> </dontSearch>
  2073.         <sharedText> <false /> </sharedText>
  2074.         <fixedLineHeight> <true /> </fixedLineHeight>
  2075.         <autoTab> <false /> </autoTab>
  2076.         <lockText> <true /> </lockText>
  2077.         <rect>
  2078.             <left>275</left>
  2079.             <top>99</top>
  2080.             <right>494</right>
  2081.             <bottom>113</bottom>
  2082.         </rect>
  2083.         <style>transparent</style>
  2084.         <autoSelect> <false /> </autoSelect>
  2085.         <showLines> <false /> </showLines>
  2086.         <wideMargins> <false /> </wideMargins>
  2087.         <multipleLines> <false /> </multipleLines>
  2088.         <reservedFamily> 0 </reservedFamily>
  2089.         <titleWidth>0</titleWidth>
  2090.         <icon>0</icon>
  2091.         <textAlign>left</textAlign>
  2092.         <font>Palatino</font>
  2093.         <textSize>10</textSize>
  2094.         <textStyle>plain</textStyle>
  2095.         <textHeight>13</textHeight>
  2096.         <name></name>
  2097.         <script>on mouseUp
  2098. visual iris open
  2099. get the number of the target
  2100. get card field (it-1)
  2101. if it is not "" then
  2102. go card it
  2103. end if
  2104. end mouseUp
  2105. </script>
  2106.     </part>
  2107.     <part>
  2108.         <id>96</id>
  2109.         <type>field</type>
  2110.         <visible> <true /> </visible>
  2111.         <dontWrap> <false /> </dontWrap>
  2112.         <dontSearch> <false /> </dontSearch>
  2113.         <sharedText> <false /> </sharedText>
  2114.         <fixedLineHeight> <true /> </fixedLineHeight>
  2115.         <autoTab> <false /> </autoTab>
  2116.         <lockText> <true /> </lockText>
  2117.         <rect>
  2118.             <left>451</left>
  2119.             <top>112</top>
  2120.             <right>494</right>
  2121.             <bottom>126</bottom>
  2122.         </rect>
  2123.         <style>transparent</style>
  2124.         <autoSelect> <false /> </autoSelect>
  2125.         <showLines> <false /> </showLines>
  2126.         <wideMargins> <false /> </wideMargins>
  2127.         <multipleLines> <false /> </multipleLines>
  2128.         <reservedFamily> 0 </reservedFamily>
  2129.         <titleWidth>0</titleWidth>
  2130.         <icon>0</icon>
  2131.         <textAlign>right</textAlign>
  2132.         <font>Palatino</font>
  2133.         <textSize>10</textSize>
  2134.         <textStyle>plain</textStyle>
  2135.         <textHeight>13</textHeight>
  2136.         <name></name>
  2137.         <script></script>
  2138.     </part>
  2139.     <part>
  2140.         <id>95</id>
  2141.         <type>field</type>
  2142.         <visible> <true /> </visible>
  2143.         <dontWrap> <false /> </dontWrap>
  2144.         <dontSearch> <false /> </dontSearch>
  2145.         <sharedText> <false /> </sharedText>
  2146.         <fixedLineHeight> <true /> </fixedLineHeight>
  2147.         <autoTab> <false /> </autoTab>
  2148.         <lockText> <true /> </lockText>
  2149.         <rect>
  2150.             <left>275</left>
  2151.             <top>112</top>
  2152.             <right>494</right>
  2153.             <bottom>126</bottom>
  2154.         </rect>
  2155.         <style>transparent</style>
  2156.         <autoSelect> <false /> </autoSelect>
  2157.         <showLines> <false /> </showLines>
  2158.         <wideMargins> <false /> </wideMargins>
  2159.         <multipleLines> <false /> </multipleLines>
  2160.         <reservedFamily> 0 </reservedFamily>
  2161.         <titleWidth>0</titleWidth>
  2162.         <icon>0</icon>
  2163.         <textAlign>left</textAlign>
  2164.         <font>Palatino</font>
  2165.         <textSize>10</textSize>
  2166.         <textStyle>plain</textStyle>
  2167.         <textHeight>13</textHeight>
  2168.         <name></name>
  2169.         <script>on mouseUp
  2170. visual iris open
  2171. get the number of the target
  2172. get card field (it-1)
  2173. if it is not "" then
  2174. go card it
  2175. end if
  2176. end mouseUp
  2177. </script>
  2178.     </part>
  2179.     <part>
  2180.         <id>98</id>
  2181.         <type>field</type>
  2182.         <visible> <true /> </visible>
  2183.         <dontWrap> <false /> </dontWrap>
  2184.         <dontSearch> <false /> </dontSearch>
  2185.         <sharedText> <false /> </sharedText>
  2186.         <fixedLineHeight> <true /> </fixedLineHeight>
  2187.         <autoTab> <false /> </autoTab>
  2188.         <lockText> <true /> </lockText>
  2189.         <rect>
  2190.             <left>451</left>
  2191.             <top>125</top>
  2192.             <right>494</right>
  2193.             <bottom>139</bottom>
  2194.         </rect>
  2195.         <style>transparent</style>
  2196.         <autoSelect> <false /> </autoSelect>
  2197.         <showLines> <false /> </showLines>
  2198.         <wideMargins> <false /> </wideMargins>
  2199.         <multipleLines> <false /> </multipleLines>
  2200.         <reservedFamily> 0 </reservedFamily>
  2201.         <titleWidth>0</titleWidth>
  2202.         <icon>0</icon>
  2203.         <textAlign>right</textAlign>
  2204.         <font>Palatino</font>
  2205.         <textSize>10</textSize>
  2206.         <textStyle>plain</textStyle>
  2207.         <textHeight>13</textHeight>
  2208.         <name></name>
  2209.         <script></script>
  2210.     </part>
  2211.     <part>
  2212.         <id>97</id>
  2213.         <type>field</type>
  2214.         <visible> <true /> </visible>
  2215.         <dontWrap> <false /> </dontWrap>
  2216.         <dontSearch> <false /> </dontSearch>
  2217.         <sharedText> <false /> </sharedText>
  2218.         <fixedLineHeight> <true /> </fixedLineHeight>
  2219.         <autoTab> <false /> </autoTab>
  2220.         <lockText> <true /> </lockText>
  2221.         <rect>
  2222.             <left>275</left>
  2223.             <top>125</top>
  2224.             <right>494</right>
  2225.             <bottom>139</bottom>
  2226.         </rect>
  2227.         <style>transparent</style>
  2228.         <autoSelect> <false /> </autoSelect>
  2229.         <showLines> <false /> </showLines>
  2230.         <wideMargins> <false /> </wideMargins>
  2231.         <multipleLines> <false /> </multipleLines>
  2232.         <reservedFamily> 0 </reservedFamily>
  2233.         <titleWidth>0</titleWidth>
  2234.         <icon>0</icon>
  2235.         <textAlign>left</textAlign>
  2236.         <font>Palatino</font>
  2237.         <textSize>10</textSize>
  2238.         <textStyle>plain</textStyle>
  2239.         <textHeight>13</textHeight>
  2240.         <name></name>
  2241.         <script>on mouseUp
  2242. visual iris open
  2243. get the number of the target
  2244. get card field (it-1)
  2245. if it is not "" then
  2246. go card it
  2247. end if
  2248. end mouseUp
  2249. </script>
  2250.     </part>
  2251.     <part>
  2252.         <id>100</id>
  2253.         <type>field</type>
  2254.         <visible> <true /> </visible>
  2255.         <dontWrap> <false /> </dontWrap>
  2256.         <dontSearch> <false /> </dontSearch>
  2257.         <sharedText> <false /> </sharedText>
  2258.         <fixedLineHeight> <true /> </fixedLineHeight>
  2259.         <autoTab> <false /> </autoTab>
  2260.         <lockText> <true /> </lockText>
  2261.         <rect>
  2262.             <left>451</left>
  2263.             <top>138</top>
  2264.             <right>494</right>
  2265.             <bottom>152</bottom>
  2266.         </rect>
  2267.         <style>transparent</style>
  2268.         <autoSelect> <false /> </autoSelect>
  2269.         <showLines> <false /> </showLines>
  2270.         <wideMargins> <false /> </wideMargins>
  2271.         <multipleLines> <false /> </multipleLines>
  2272.         <reservedFamily> 0 </reservedFamily>
  2273.         <titleWidth>0</titleWidth>
  2274.         <icon>0</icon>
  2275.         <textAlign>right</textAlign>
  2276.         <font>Palatino</font>
  2277.         <textSize>10</textSize>
  2278.         <textStyle>plain</textStyle>
  2279.         <textHeight>13</textHeight>
  2280.         <name></name>
  2281.         <script></script>
  2282.     </part>
  2283.     <part>
  2284.         <id>99</id>
  2285.         <type>field</type>
  2286.         <visible> <true /> </visible>
  2287.         <dontWrap> <false /> </dontWrap>
  2288.         <dontSearch> <false /> </dontSearch>
  2289.         <sharedText> <false /> </sharedText>
  2290.         <fixedLineHeight> <true /> </fixedLineHeight>
  2291.         <autoTab> <false /> </autoTab>
  2292.         <lockText> <true /> </lockText>
  2293.         <rect>
  2294.             <left>275</left>
  2295.             <top>138</top>
  2296.             <right>494</right>
  2297.             <bottom>152</bottom>
  2298.         </rect>
  2299.         <style>transparent</style>
  2300.         <autoSelect> <false /> </autoSelect>
  2301.         <showLines> <false /> </showLines>
  2302.         <wideMargins> <false /> </wideMargins>
  2303.         <multipleLines> <false /> </multipleLines>
  2304.         <reservedFamily> 0 </reservedFamily>
  2305.         <titleWidth>0</titleWidth>
  2306.         <icon>0</icon>
  2307.         <textAlign>left</textAlign>
  2308.         <font>Palatino</font>
  2309.         <textSize>10</textSize>
  2310.         <textStyle>plain</textStyle>
  2311.         <textHeight>13</textHeight>
  2312.         <name></name>
  2313.         <script>on mouseUp
  2314. visual iris open
  2315. get the number of the target
  2316. get card field (it-1)
  2317. if it is not "" then
  2318. go card it
  2319. end if
  2320. end mouseUp
  2321. </script>
  2322.     </part>
  2323.     <part>
  2324.         <id>102</id>
  2325.         <type>field</type>
  2326.         <visible> <true /> </visible>
  2327.         <dontWrap> <false /> </dontWrap>
  2328.         <dontSearch> <false /> </dontSearch>
  2329.         <sharedText> <false /> </sharedText>
  2330.         <fixedLineHeight> <true /> </fixedLineHeight>
  2331.         <autoTab> <false /> </autoTab>
  2332.         <lockText> <true /> </lockText>
  2333.         <rect>
  2334.             <left>451</left>
  2335.             <top>151</top>
  2336.             <right>494</right>
  2337.             <bottom>165</bottom>
  2338.         </rect>
  2339.         <style>transparent</style>
  2340.         <autoSelect> <false /> </autoSelect>
  2341.         <showLines> <false /> </showLines>
  2342.         <wideMargins> <false /> </wideMargins>
  2343.         <multipleLines> <false /> </multipleLines>
  2344.         <reservedFamily> 0 </reservedFamily>
  2345.         <titleWidth>0</titleWidth>
  2346.         <icon>0</icon>
  2347.         <textAlign>right</textAlign>
  2348.         <font>Palatino</font>
  2349.         <textSize>10</textSize>
  2350.         <textStyle>plain</textStyle>
  2351.         <textHeight>13</textHeight>
  2352.         <name></name>
  2353.         <script></script>
  2354.     </part>
  2355.     <part>
  2356.         <id>101</id>
  2357.         <type>field</type>
  2358.         <visible> <true /> </visible>
  2359.         <dontWrap> <false /> </dontWrap>
  2360.         <dontSearch> <false /> </dontSearch>
  2361.         <sharedText> <false /> </sharedText>
  2362.         <fixedLineHeight> <true /> </fixedLineHeight>
  2363.         <autoTab> <false /> </autoTab>
  2364.         <lockText> <true /> </lockText>
  2365.         <rect>
  2366.             <left>275</left>
  2367.             <top>151</top>
  2368.             <right>494</right>
  2369.             <bottom>165</bottom>
  2370.         </rect>
  2371.         <style>transparent</style>
  2372.         <autoSelect> <false /> </autoSelect>
  2373.         <showLines> <false /> </showLines>
  2374.         <wideMargins> <false /> </wideMargins>
  2375.         <multipleLines> <false /> </multipleLines>
  2376.         <reservedFamily> 0 </reservedFamily>
  2377.         <titleWidth>0</titleWidth>
  2378.         <icon>0</icon>
  2379.         <textAlign>left</textAlign>
  2380.         <font>Palatino</font>
  2381.         <textSize>10</textSize>
  2382.         <textStyle>plain</textStyle>
  2383.         <textHeight>13</textHeight>
  2384.         <name></name>
  2385.         <script>on mouseUp
  2386. visual iris open
  2387. get the number of the target
  2388. get card field (it-1)
  2389. if it is not "" then
  2390. go card it
  2391. end if
  2392. end mouseUp
  2393. </script>
  2394.     </part>
  2395.     <part>
  2396.         <id>104</id>
  2397.         <type>field</type>
  2398.         <visible> <true /> </visible>
  2399.         <dontWrap> <false /> </dontWrap>
  2400.         <dontSearch> <false /> </dontSearch>
  2401.         <sharedText> <false /> </sharedText>
  2402.         <fixedLineHeight> <true /> </fixedLineHeight>
  2403.         <autoTab> <false /> </autoTab>
  2404.         <lockText> <true /> </lockText>
  2405.         <rect>
  2406.             <left>451</left>
  2407.             <top>164</top>
  2408.             <right>494</right>
  2409.             <bottom>178</bottom>
  2410.         </rect>
  2411.         <style>transparent</style>
  2412.         <autoSelect> <false /> </autoSelect>
  2413.         <showLines> <false /> </showLines>
  2414.         <wideMargins> <false /> </wideMargins>
  2415.         <multipleLines> <false /> </multipleLines>
  2416.         <reservedFamily> 0 </reservedFamily>
  2417.         <titleWidth>0</titleWidth>
  2418.         <icon>0</icon>
  2419.         <textAlign>right</textAlign>
  2420.         <font>Palatino</font>
  2421.         <textSize>10</textSize>
  2422.         <textStyle>plain</textStyle>
  2423.         <textHeight>13</textHeight>
  2424.         <name></name>
  2425.         <script></script>
  2426.     </part>
  2427.     <part>
  2428.         <id>103</id>
  2429.         <type>field</type>
  2430.         <visible> <true /> </visible>
  2431.         <dontWrap> <false /> </dontWrap>
  2432.         <dontSearch> <false /> </dontSearch>
  2433.         <sharedText> <false /> </sharedText>
  2434.         <fixedLineHeight> <true /> </fixedLineHeight>
  2435.         <autoTab> <false /> </autoTab>
  2436.         <lockText> <true /> </lockText>
  2437.         <rect>
  2438.             <left>275</left>
  2439.             <top>164</top>
  2440.             <right>494</right>
  2441.             <bottom>178</bottom>
  2442.         </rect>
  2443.         <style>transparent</style>
  2444.         <autoSelect> <false /> </autoSelect>
  2445.         <showLines> <false /> </showLines>
  2446.         <wideMargins> <false /> </wideMargins>
  2447.         <multipleLines> <false /> </multipleLines>
  2448.         <reservedFamily> 0 </reservedFamily>
  2449.         <titleWidth>0</titleWidth>
  2450.         <icon>0</icon>
  2451.         <textAlign>left</textAlign>
  2452.         <font>Palatino</font>
  2453.         <textSize>10</textSize>
  2454.         <textStyle>plain</textStyle>
  2455.         <textHeight>13</textHeight>
  2456.         <name></name>
  2457.         <script>on mouseUp
  2458. visual iris open
  2459. get the number of the target
  2460. get card field (it-1)
  2461. if it is not "" then
  2462. go card it
  2463. end if
  2464. end mouseUp
  2465. </script>
  2466.     </part>
  2467.     <part>
  2468.         <id>106</id>
  2469.         <type>field</type>
  2470.         <visible> <true /> </visible>
  2471.         <dontWrap> <false /> </dontWrap>
  2472.         <dontSearch> <false /> </dontSearch>
  2473.         <sharedText> <false /> </sharedText>
  2474.         <fixedLineHeight> <true /> </fixedLineHeight>
  2475.         <autoTab> <false /> </autoTab>
  2476.         <lockText> <true /> </lockText>
  2477.         <rect>
  2478.             <left>451</left>
  2479.             <top>177</top>
  2480.             <right>494</right>
  2481.             <bottom>191</bottom>
  2482.         </rect>
  2483.         <style>transparent</style>
  2484.         <autoSelect> <false /> </autoSelect>
  2485.         <showLines> <false /> </showLines>
  2486.         <wideMargins> <false /> </wideMargins>
  2487.         <multipleLines> <false /> </multipleLines>
  2488.         <reservedFamily> 0 </reservedFamily>
  2489.         <titleWidth>0</titleWidth>
  2490.         <icon>0</icon>
  2491.         <textAlign>right</textAlign>
  2492.         <font>Palatino</font>
  2493.         <textSize>10</textSize>
  2494.         <textStyle>plain</textStyle>
  2495.         <textHeight>13</textHeight>
  2496.         <name></name>
  2497.         <script></script>
  2498.     </part>
  2499.     <part>
  2500.         <id>105</id>
  2501.         <type>field</type>
  2502.         <visible> <true /> </visible>
  2503.         <dontWrap> <false /> </dontWrap>
  2504.         <dontSearch> <false /> </dontSearch>
  2505.         <sharedText> <false /> </sharedText>
  2506.         <fixedLineHeight> <true /> </fixedLineHeight>
  2507.         <autoTab> <false /> </autoTab>
  2508.         <lockText> <true /> </lockText>
  2509.         <rect>
  2510.             <left>275</left>
  2511.             <top>177</top>
  2512.             <right>494</right>
  2513.             <bottom>191</bottom>
  2514.         </rect>
  2515.         <style>transparent</style>
  2516.         <autoSelect> <false /> </autoSelect>
  2517.         <showLines> <false /> </showLines>
  2518.         <wideMargins> <false /> </wideMargins>
  2519.         <multipleLines> <false /> </multipleLines>
  2520.         <reservedFamily> 0 </reservedFamily>
  2521.         <titleWidth>0</titleWidth>
  2522.         <icon>0</icon>
  2523.         <textAlign>left</textAlign>
  2524.         <font>Palatino</font>
  2525.         <textSize>10</textSize>
  2526.         <textStyle>plain</textStyle>
  2527.         <textHeight>13</textHeight>
  2528.         <name></name>
  2529.         <script>on mouseUp
  2530. visual iris open
  2531. get the number of the target
  2532. get card field (it-1)
  2533. if it is not "" then
  2534. go card it
  2535. end if
  2536. end mouseUp
  2537. </script>
  2538.     </part>
  2539.     <part>
  2540.         <id>108</id>
  2541.         <type>field</type>
  2542.         <visible> <true /> </visible>
  2543.         <dontWrap> <false /> </dontWrap>
  2544.         <dontSearch> <false /> </dontSearch>
  2545.         <sharedText> <false /> </sharedText>
  2546.         <fixedLineHeight> <true /> </fixedLineHeight>
  2547.         <autoTab> <false /> </autoTab>
  2548.         <lockText> <true /> </lockText>
  2549.         <rect>
  2550.             <left>451</left>
  2551.             <top>190</top>
  2552.             <right>494</right>
  2553.             <bottom>204</bottom>
  2554.         </rect>
  2555.         <style>transparent</style>
  2556.         <autoSelect> <false /> </autoSelect>
  2557.         <showLines> <false /> </showLines>
  2558.         <wideMargins> <false /> </wideMargins>
  2559.         <multipleLines> <false /> </multipleLines>
  2560.         <reservedFamily> 0 </reservedFamily>
  2561.         <titleWidth>0</titleWidth>
  2562.         <icon>0</icon>
  2563.         <textAlign>right</textAlign>
  2564.         <font>Palatino</font>
  2565.         <textSize>10</textSize>
  2566.         <textStyle>plain</textStyle>
  2567.         <textHeight>13</textHeight>
  2568.         <name></name>
  2569.         <script></script>
  2570.     </part>
  2571.     <part>
  2572.         <id>107</id>
  2573.         <type>field</type>
  2574.         <visible> <true /> </visible>
  2575.         <dontWrap> <false /> </dontWrap>
  2576.         <dontSearch> <false /> </dontSearch>
  2577.         <sharedText> <false /> </sharedText>
  2578.         <fixedLineHeight> <true /> </fixedLineHeight>
  2579.         <autoTab> <false /> </autoTab>
  2580.         <lockText> <true /> </lockText>
  2581.         <rect>
  2582.             <left>275</left>
  2583.             <top>190</top>
  2584.             <right>494</right>
  2585.             <bottom>204</bottom>
  2586.         </rect>
  2587.         <style>transparent</style>
  2588.         <autoSelect> <false /> </autoSelect>
  2589.         <showLines> <false /> </showLines>
  2590.         <wideMargins> <false /> </wideMargins>
  2591.         <multipleLines> <false /> </multipleLines>
  2592.         <reservedFamily> 0 </reservedFamily>
  2593.         <titleWidth>0</titleWidth>
  2594.         <icon>0</icon>
  2595.         <textAlign>left</textAlign>
  2596.         <font>Palatino</font>
  2597.         <textSize>10</textSize>
  2598.         <textStyle>plain</textStyle>
  2599.         <textHeight>13</textHeight>
  2600.         <name></name>
  2601.         <script>on mouseUp
  2602. visual iris open
  2603. get the number of the target
  2604. get card field (it-1)
  2605. if it is not "" then
  2606. go card it
  2607. end if
  2608. end mouseUp
  2609. </script>
  2610.     </part>
  2611.     <part>
  2612.         <id>110</id>
  2613.         <type>field</type>
  2614.         <visible> <true /> </visible>
  2615.         <dontWrap> <false /> </dontWrap>
  2616.         <dontSearch> <false /> </dontSearch>
  2617.         <sharedText> <false /> </sharedText>
  2618.         <fixedLineHeight> <true /> </fixedLineHeight>
  2619.         <autoTab> <false /> </autoTab>
  2620.         <lockText> <true /> </lockText>
  2621.         <rect>
  2622.             <left>451</left>
  2623.             <top>203</top>
  2624.             <right>494</right>
  2625.             <bottom>217</bottom>
  2626.         </rect>
  2627.         <style>transparent</style>
  2628.         <autoSelect> <false /> </autoSelect>
  2629.         <showLines> <false /> </showLines>
  2630.         <wideMargins> <false /> </wideMargins>
  2631.         <multipleLines> <false /> </multipleLines>
  2632.         <reservedFamily> 0 </reservedFamily>
  2633.         <titleWidth>0</titleWidth>
  2634.         <icon>0</icon>
  2635.         <textAlign>right</textAlign>
  2636.         <font>Palatino</font>
  2637.         <textSize>10</textSize>
  2638.         <textStyle>plain</textStyle>
  2639.         <textHeight>13</textHeight>
  2640.         <name></name>
  2641.         <script></script>
  2642.     </part>
  2643.     <part>
  2644.         <id>109</id>
  2645.         <type>field</type>
  2646.         <visible> <true /> </visible>
  2647.         <dontWrap> <false /> </dontWrap>
  2648.         <dontSearch> <false /> </dontSearch>
  2649.         <sharedText> <false /> </sharedText>
  2650.         <fixedLineHeight> <true /> </fixedLineHeight>
  2651.         <autoTab> <false /> </autoTab>
  2652.         <lockText> <true /> </lockText>
  2653.         <rect>
  2654.             <left>275</left>
  2655.             <top>203</top>
  2656.             <right>494</right>
  2657.             <bottom>217</bottom>
  2658.         </rect>
  2659.         <style>transparent</style>
  2660.         <autoSelect> <false /> </autoSelect>
  2661.         <showLines> <false /> </showLines>
  2662.         <wideMargins> <false /> </wideMargins>
  2663.         <multipleLines> <false /> </multipleLines>
  2664.         <reservedFamily> 0 </reservedFamily>
  2665.         <titleWidth>0</titleWidth>
  2666.         <icon>0</icon>
  2667.         <textAlign>left</textAlign>
  2668.         <font>Palatino</font>
  2669.         <textSize>10</textSize>
  2670.         <textStyle>plain</textStyle>
  2671.         <textHeight>13</textHeight>
  2672.         <name></name>
  2673.         <script>on mouseUp
  2674. visual iris open
  2675. get the number of the target
  2676. get card field (it-1)
  2677. if it is not "" then
  2678. go card it
  2679. end if
  2680. end mouseUp
  2681. </script>
  2682.     </part>
  2683.     <part>
  2684.         <id>112</id>
  2685.         <type>field</type>
  2686.         <visible> <true /> </visible>
  2687.         <dontWrap> <false /> </dontWrap>
  2688.         <dontSearch> <false /> </dontSearch>
  2689.         <sharedText> <false /> </sharedText>
  2690.         <fixedLineHeight> <true /> </fixedLineHeight>
  2691.         <autoTab> <false /> </autoTab>
  2692.         <lockText> <true /> </lockText>
  2693.         <rect>
  2694.             <left>451</left>
  2695.             <top>216</top>
  2696.             <right>494</right>
  2697.             <bottom>230</bottom>
  2698.         </rect>
  2699.         <style>transparent</style>
  2700.         <autoSelect> <false /> </autoSelect>
  2701.         <showLines> <false /> </showLines>
  2702.         <wideMargins> <false /> </wideMargins>
  2703.         <multipleLines> <false /> </multipleLines>
  2704.         <reservedFamily> 0 </reservedFamily>
  2705.         <titleWidth>0</titleWidth>
  2706.         <icon>0</icon>
  2707.         <textAlign>right</textAlign>
  2708.         <font>Palatino</font>
  2709.         <textSize>10</textSize>
  2710.         <textStyle>plain</textStyle>
  2711.         <textHeight>13</textHeight>
  2712.         <name></name>
  2713.         <script></script>
  2714.     </part>
  2715.     <part>
  2716.         <id>111</id>
  2717.         <type>field</type>
  2718.         <visible> <true /> </visible>
  2719.         <dontWrap> <false /> </dontWrap>
  2720.         <dontSearch> <false /> </dontSearch>
  2721.         <sharedText> <false /> </sharedText>
  2722.         <fixedLineHeight> <true /> </fixedLineHeight>
  2723.         <autoTab> <false /> </autoTab>
  2724.         <lockText> <true /> </lockText>
  2725.         <rect>
  2726.             <left>275</left>
  2727.             <top>216</top>
  2728.             <right>494</right>
  2729.             <bottom>230</bottom>
  2730.         </rect>
  2731.         <style>transparent</style>
  2732.         <autoSelect> <false /> </autoSelect>
  2733.         <showLines> <false /> </showLines>
  2734.         <wideMargins> <false /> </wideMargins>
  2735.         <multipleLines> <false /> </multipleLines>
  2736.         <reservedFamily> 0 </reservedFamily>
  2737.         <titleWidth>0</titleWidth>
  2738.         <icon>0</icon>
  2739.         <textAlign>left</textAlign>
  2740.         <font>Palatino</font>
  2741.         <textSize>10</textSize>
  2742.         <textStyle>plain</textStyle>
  2743.         <textHeight>13</textHeight>
  2744.         <name></name>
  2745.         <script>on mouseUp
  2746. visual iris open
  2747. get the number of the target
  2748. get card field (it-1)
  2749. if it is not "" then
  2750. go card it
  2751. end if
  2752. end mouseUp
  2753. </script>
  2754.     </part>
  2755.     <part>
  2756.         <id>114</id>
  2757.         <type>field</type>
  2758.         <visible> <true /> </visible>
  2759.         <dontWrap> <false /> </dontWrap>
  2760.         <dontSearch> <false /> </dontSearch>
  2761.         <sharedText> <false /> </sharedText>
  2762.         <fixedLineHeight> <true /> </fixedLineHeight>
  2763.         <autoTab> <false /> </autoTab>
  2764.         <lockText> <true /> </lockText>
  2765.         <rect>
  2766.             <left>451</left>
  2767.             <top>229</top>
  2768.             <right>494</right>
  2769.             <bottom>243</bottom>
  2770.         </rect>
  2771.         <style>transparent</style>
  2772.         <autoSelect> <false /> </autoSelect>
  2773.         <showLines> <false /> </showLines>
  2774.         <wideMargins> <false /> </wideMargins>
  2775.         <multipleLines> <false /> </multipleLines>
  2776.         <reservedFamily> 0 </reservedFamily>
  2777.         <titleWidth>0</titleWidth>
  2778.         <icon>0</icon>
  2779.         <textAlign>right</textAlign>
  2780.         <font>Palatino</font>
  2781.         <textSize>10</textSize>
  2782.         <textStyle>plain</textStyle>
  2783.         <textHeight>13</textHeight>
  2784.         <name></name>
  2785.         <script></script>
  2786.     </part>
  2787.     <part>
  2788.         <id>113</id>
  2789.         <type>field</type>
  2790.         <visible> <true /> </visible>
  2791.         <dontWrap> <false /> </dontWrap>
  2792.         <dontSearch> <false /> </dontSearch>
  2793.         <sharedText> <false /> </sharedText>
  2794.         <fixedLineHeight> <true /> </fixedLineHeight>
  2795.         <autoTab> <false /> </autoTab>
  2796.         <lockText> <true /> </lockText>
  2797.         <rect>
  2798.             <left>275</left>
  2799.             <top>229</top>
  2800.             <right>494</right>
  2801.             <bottom>243</bottom>
  2802.         </rect>
  2803.         <style>transparent</style>
  2804.         <autoSelect> <false /> </autoSelect>
  2805.         <showLines> <false /> </showLines>
  2806.         <wideMargins> <false /> </wideMargins>
  2807.         <multipleLines> <false /> </multipleLines>
  2808.         <reservedFamily> 0 </reservedFamily>
  2809.         <titleWidth>0</titleWidth>
  2810.         <icon>0</icon>
  2811.         <textAlign>left</textAlign>
  2812.         <font>Palatino</font>
  2813.         <textSize>10</textSize>
  2814.         <textStyle>plain</textStyle>
  2815.         <textHeight>13</textHeight>
  2816.         <name></name>
  2817.         <script>on mouseUp
  2818. visual iris open
  2819. get the number of the target
  2820. get card field (it-1)
  2821. if it is not "" then
  2822. go card it
  2823. end if
  2824. end mouseUp
  2825. </script>
  2826.     </part>
  2827.     <part>
  2828.         <id>116</id>
  2829.         <type>field</type>
  2830.         <visible> <true /> </visible>
  2831.         <dontWrap> <false /> </dontWrap>
  2832.         <dontSearch> <false /> </dontSearch>
  2833.         <sharedText> <false /> </sharedText>
  2834.         <fixedLineHeight> <true /> </fixedLineHeight>
  2835.         <autoTab> <false /> </autoTab>
  2836.         <lockText> <true /> </lockText>
  2837.         <rect>
  2838.             <left>451</left>
  2839.             <top>242</top>
  2840.             <right>494</right>
  2841.             <bottom>256</bottom>
  2842.         </rect>
  2843.         <style>transparent</style>
  2844.         <autoSelect> <false /> </autoSelect>
  2845.         <showLines> <false /> </showLines>
  2846.         <wideMargins> <false /> </wideMargins>
  2847.         <multipleLines> <false /> </multipleLines>
  2848.         <reservedFamily> 0 </reservedFamily>
  2849.         <titleWidth>0</titleWidth>
  2850.         <icon>0</icon>
  2851.         <textAlign>right</textAlign>
  2852.         <font>Palatino</font>
  2853.         <textSize>10</textSize>
  2854.         <textStyle>plain</textStyle>
  2855.         <textHeight>13</textHeight>
  2856.         <name></name>
  2857.         <script></script>
  2858.     </part>
  2859.     <part>
  2860.         <id>115</id>
  2861.         <type>field</type>
  2862.         <visible> <true /> </visible>
  2863.         <dontWrap> <false /> </dontWrap>
  2864.         <dontSearch> <false /> </dontSearch>
  2865.         <sharedText> <false /> </sharedText>
  2866.         <fixedLineHeight> <true /> </fixedLineHeight>
  2867.         <autoTab> <false /> </autoTab>
  2868.         <lockText> <true /> </lockText>
  2869.         <rect>
  2870.             <left>275</left>
  2871.             <top>242</top>
  2872.             <right>494</right>
  2873.             <bottom>256</bottom>
  2874.         </rect>
  2875.         <style>transparent</style>
  2876.         <autoSelect> <false /> </autoSelect>
  2877.         <showLines> <false /> </showLines>
  2878.         <wideMargins> <false /> </wideMargins>
  2879.         <multipleLines> <false /> </multipleLines>
  2880.         <reservedFamily> 0 </reservedFamily>
  2881.         <titleWidth>0</titleWidth>
  2882.         <icon>0</icon>
  2883.         <textAlign>left</textAlign>
  2884.         <font>Palatino</font>
  2885.         <textSize>10</textSize>
  2886.         <textStyle>plain</textStyle>
  2887.         <textHeight>13</textHeight>
  2888.         <name></name>
  2889.         <script>on mouseUp
  2890. visual iris open
  2891. get the number of the target
  2892. get card field (it-1)
  2893. if it is not "" then
  2894. go card it
  2895. end if
  2896. end mouseUp
  2897. </script>
  2898.     </part>
  2899.     <part>
  2900.         <id>118</id>
  2901.         <type>field</type>
  2902.         <visible> <true /> </visible>
  2903.         <dontWrap> <false /> </dontWrap>
  2904.         <dontSearch> <false /> </dontSearch>
  2905.         <sharedText> <false /> </sharedText>
  2906.         <fixedLineHeight> <true /> </fixedLineHeight>
  2907.         <autoTab> <false /> </autoTab>
  2908.         <lockText> <true /> </lockText>
  2909.         <rect>
  2910.             <left>451</left>
  2911.             <top>255</top>
  2912.             <right>494</right>
  2913.             <bottom>269</bottom>
  2914.         </rect>
  2915.         <style>transparent</style>
  2916.         <autoSelect> <false /> </autoSelect>
  2917.         <showLines> <false /> </showLines>
  2918.         <wideMargins> <false /> </wideMargins>
  2919.         <multipleLines> <false /> </multipleLines>
  2920.         <reservedFamily> 0 </reservedFamily>
  2921.         <titleWidth>0</titleWidth>
  2922.         <icon>0</icon>
  2923.         <textAlign>right</textAlign>
  2924.         <font>Palatino</font>
  2925.         <textSize>10</textSize>
  2926.         <textStyle>plain</textStyle>
  2927.         <textHeight>13</textHeight>
  2928.         <name></name>
  2929.         <script></script>
  2930.     </part>
  2931.     <part>
  2932.         <id>117</id>
  2933.         <type>field</type>
  2934.         <visible> <true /> </visible>
  2935.         <dontWrap> <false /> </dontWrap>
  2936.         <dontSearch> <false /> </dontSearch>
  2937.         <sharedText> <false /> </sharedText>
  2938.         <fixedLineHeight> <true /> </fixedLineHeight>
  2939.         <autoTab> <false /> </autoTab>
  2940.         <lockText> <true /> </lockText>
  2941.         <rect>
  2942.             <left>275</left>
  2943.             <top>255</top>
  2944.             <right>494</right>
  2945.             <bottom>269</bottom>
  2946.         </rect>
  2947.         <style>transparent</style>
  2948.         <autoSelect> <false /> </autoSelect>
  2949.         <showLines> <false /> </showLines>
  2950.         <wideMargins> <false /> </wideMargins>
  2951.         <multipleLines> <false /> </multipleLines>
  2952.         <reservedFamily> 0 </reservedFamily>
  2953.         <titleWidth>0</titleWidth>
  2954.         <icon>0</icon>
  2955.         <textAlign>left</textAlign>
  2956.         <font>Palatino</font>
  2957.         <textSize>10</textSize>
  2958.         <textStyle>plain</textStyle>
  2959.         <textHeight>13</textHeight>
  2960.         <name></name>
  2961.         <script>on mouseUp
  2962. visual iris open
  2963. get the number of the target
  2964. get card field (it-1)
  2965. if it is not "" then
  2966. go card it
  2967. end if
  2968. end mouseUp
  2969. </script>
  2970.     </part>
  2971.     <part>
  2972.         <id>120</id>
  2973.         <type>field</type>
  2974.         <visible> <true /> </visible>
  2975.         <dontWrap> <false /> </dontWrap>
  2976.         <dontSearch> <false /> </dontSearch>
  2977.         <sharedText> <false /> </sharedText>
  2978.         <fixedLineHeight> <true /> </fixedLineHeight>
  2979.         <autoTab> <false /> </autoTab>
  2980.         <lockText> <true /> </lockText>
  2981.         <rect>
  2982.             <left>451</left>
  2983.             <top>268</top>
  2984.             <right>494</right>
  2985.             <bottom>282</bottom>
  2986.         </rect>
  2987.         <style>transparent</style>
  2988.         <autoSelect> <false /> </autoSelect>
  2989.         <showLines> <false /> </showLines>
  2990.         <wideMargins> <false /> </wideMargins>
  2991.         <multipleLines> <false /> </multipleLines>
  2992.         <reservedFamily> 0 </reservedFamily>
  2993.         <titleWidth>0</titleWidth>
  2994.         <icon>0</icon>
  2995.         <textAlign>right</textAlign>
  2996.         <font>Palatino</font>
  2997.         <textSize>10</textSize>
  2998.         <textStyle>plain</textStyle>
  2999.         <textHeight>13</textHeight>
  3000.         <name></name>
  3001.         <script></script>
  3002.     </part>
  3003.     <part>
  3004.         <id>119</id>
  3005.         <type>field</type>
  3006.         <visible> <true /> </visible>
  3007.         <dontWrap> <false /> </dontWrap>
  3008.         <dontSearch> <false /> </dontSearch>
  3009.         <sharedText> <false /> </sharedText>
  3010.         <fixedLineHeight> <true /> </fixedLineHeight>
  3011.         <autoTab> <false /> </autoTab>
  3012.         <lockText> <true /> </lockText>
  3013.         <rect>
  3014.             <left>275</left>
  3015.             <top>268</top>
  3016.             <right>494</right>
  3017.             <bottom>282</bottom>
  3018.         </rect>
  3019.         <style>transparent</style>
  3020.         <autoSelect> <false /> </autoSelect>
  3021.         <showLines> <false /> </showLines>
  3022.         <wideMargins> <false /> </wideMargins>
  3023.         <multipleLines> <false /> </multipleLines>
  3024.         <reservedFamily> 0 </reservedFamily>
  3025.         <titleWidth>0</titleWidth>
  3026.         <icon>0</icon>
  3027.         <textAlign>left</textAlign>
  3028.         <font>Palatino</font>
  3029.         <textSize>10</textSize>
  3030.         <textStyle>plain</textStyle>
  3031.         <textHeight>13</textHeight>
  3032.         <name></name>
  3033.         <script>on mouseUp
  3034. visual iris open
  3035. get the number of the target
  3036. get card field (it-1)
  3037. if it is not "" then
  3038. go card it
  3039. end if
  3040. end mouseUp
  3041. </script>
  3042.     </part>
  3043.     <part>
  3044.         <id>122</id>
  3045.         <type>field</type>
  3046.         <visible> <true /> </visible>
  3047.         <dontWrap> <false /> </dontWrap>
  3048.         <dontSearch> <false /> </dontSearch>
  3049.         <sharedText> <false /> </sharedText>
  3050.         <fixedLineHeight> <true /> </fixedLineHeight>
  3051.         <autoTab> <false /> </autoTab>
  3052.         <lockText> <true /> </lockText>
  3053.         <rect>
  3054.             <left>451</left>
  3055.             <top>281</top>
  3056.             <right>494</right>
  3057.             <bottom>295</bottom>
  3058.         </rect>
  3059.         <style>transparent</style>
  3060.         <autoSelect> <false /> </autoSelect>
  3061.         <showLines> <false /> </showLines>
  3062.         <wideMargins> <false /> </wideMargins>
  3063.         <multipleLines> <false /> </multipleLines>
  3064.         <reservedFamily> 0 </reservedFamily>
  3065.         <titleWidth>0</titleWidth>
  3066.         <icon>0</icon>
  3067.         <textAlign>right</textAlign>
  3068.         <font>Palatino</font>
  3069.         <textSize>10</textSize>
  3070.         <textStyle>plain</textStyle>
  3071.         <textHeight>13</textHeight>
  3072.         <name></name>
  3073.         <script></script>
  3074.     </part>
  3075.     <part>
  3076.         <id>121</id>
  3077.         <type>field</type>
  3078.         <visible> <true /> </visible>
  3079.         <dontWrap> <false /> </dontWrap>
  3080.         <dontSearch> <false /> </dontSearch>
  3081.         <sharedText> <false /> </sharedText>
  3082.         <fixedLineHeight> <true /> </fixedLineHeight>
  3083.         <autoTab> <false /> </autoTab>
  3084.         <lockText> <true /> </lockText>
  3085.         <rect>
  3086.             <left>275</left>
  3087.             <top>281</top>
  3088.             <right>494</right>
  3089.             <bottom>295</bottom>
  3090.         </rect>
  3091.         <style>transparent</style>
  3092.         <autoSelect> <false /> </autoSelect>
  3093.         <showLines> <false /> </showLines>
  3094.         <wideMargins> <false /> </wideMargins>
  3095.         <multipleLines> <false /> </multipleLines>
  3096.         <reservedFamily> 0 </reservedFamily>
  3097.         <titleWidth>0</titleWidth>
  3098.         <icon>0</icon>
  3099.         <textAlign>left</textAlign>
  3100.         <font>Palatino</font>
  3101.         <textSize>10</textSize>
  3102.         <textStyle>plain</textStyle>
  3103.         <textHeight>13</textHeight>
  3104.         <name></name>
  3105.         <script>on mouseUp
  3106. visual iris open
  3107. get the number of the target
  3108. get card field (it-1)
  3109. if it is not "" then
  3110. go card it
  3111. end if
  3112. end mouseUp
  3113. </script>
  3114.     </part>
  3115.     <part>
  3116.         <id>124</id>
  3117.         <type>button</type>
  3118.         <visible> <false /> </visible>
  3119.         <reserved5> 0 </reserved5>
  3120.         <reserved4> 0 </reserved4>
  3121.         <reserved3> 0 </reserved3>
  3122.         <reserved2> 0 </reserved2>
  3123.         <reserved1> 0 </reserved1>
  3124.         <enabled> <true /> </enabled>
  3125.         <rect>
  3126.             <left>1</left>
  3127.             <top>21</top>
  3128.             <right>510</right>
  3129.             <bottom>340</bottom>
  3130.         </rect>
  3131.         <style>transparent</style>
  3132.         <showName> <false /> </showName>
  3133.         <highlight> <false /> </highlight>
  3134.         <autoHighlight> <false /> </autoHighlight>
  3135.         <sharedHighlight> <true /> </sharedHighlight>
  3136.         <family>0</family>
  3137.         <titleWidth>0</titleWidth>
  3138.         <icon>0</icon>
  3139.         <textAlign>center</textAlign>
  3140.         <font>Chicago</font>
  3141.         <textSize>12</textSize>
  3142.         <textStyle>plain</textStyle>
  3143.         <name>beep</name>
  3144.         <script>on mouseUp
  3145. beep
  3146. end mouseUp
  3147. </script>
  3148.     </part>
  3149.     <part>
  3150.         <id>123</id>
  3151.         <type>field</type>
  3152.         <visible> <false /> </visible>
  3153.         <dontWrap> <false /> </dontWrap>
  3154.         <dontSearch> <false /> </dontSearch>
  3155.         <sharedText> <false /> </sharedText>
  3156.         <fixedLineHeight> <true /> </fixedLineHeight>
  3157.         <autoTab> <false /> </autoTab>
  3158.         <lockText> <false /> </lockText>
  3159.         <rect>
  3160.             <left>170</left>
  3161.             <top>81</top>
  3162.             <right>339</right>
  3163.             <bottom>300</bottom>
  3164.         </rect>
  3165.         <style>scrolling</style>
  3166.         <autoSelect> <false /> </autoSelect>
  3167.         <showLines> <false /> </showLines>
  3168.         <wideMargins> <false /> </wideMargins>
  3169.         <multipleLines> <false /> </multipleLines>
  3170.         <reservedFamily> 0 </reservedFamily>
  3171.         <titleWidth>0</titleWidth>
  3172.         <icon>0</icon>
  3173.         <textAlign>left</textAlign>
  3174.         <font>Palatino</font>
  3175.         <textSize>9</textSize>
  3176.         <textStyle>plain</textStyle>
  3177.         <textHeight>12</textHeight>
  3178.         <name>content list</name>
  3179.         <script></script>
  3180.     </part>
  3181.     <part>
  3182.         <id>125</id>
  3183.         <type>button</type>
  3184.         <visible> <false /> </visible>
  3185.         <reserved5> 0 </reserved5>
  3186.         <reserved4> 0 </reserved4>
  3187.         <reserved3> 0 </reserved3>
  3188.         <reserved2> 0 </reserved2>
  3189.         <reserved1> 0 </reserved1>
  3190.         <enabled> <true /> </enabled>
  3191.         <rect>
  3192.             <left>364</left>
  3193.             <top>26</top>
  3194.             <right>466</right>
  3195.             <bottom>43</bottom>
  3196.         </rect>
  3197.         <style>roundrect</style>
  3198.         <showName> <true /> </showName>
  3199.         <highlight> <false /> </highlight>
  3200.         <autoHighlight> <true /> </autoHighlight>
  3201.         <sharedHighlight> <true /> </sharedHighlight>
  3202.         <family>0</family>
  3203.         <titleWidth>0</titleWidth>
  3204.         <icon>0</icon>
  3205.         <textAlign>center</textAlign>
  3206.         <font>Chicago</font>
  3207.         <textSize>12</textSize>
  3208.         <textStyle>plain</textStyle>
  3209.         <name>Done Changes</name>
  3210.         <script>on mouseUp
  3211. hide card button "beep"
  3212. hide card button "Enter ID of desired card"
  3213. hide card field "content list"
  3214. hide card button "Done Changes"
  3215. show card button "Add Topic"
  3216. show card field "updating"
  3217. send updateContents
  3218. hide card field "updating"
  3219. end mouseUp
  3220. </script>
  3221.     </part>
  3222.     <part>
  3223.         <id>126</id>
  3224.         <type>button</type>
  3225.         <visible> <false /> </visible>
  3226.         <reserved5> 0 </reserved5>
  3227.         <reserved4> 0 </reserved4>
  3228.         <reserved3> 0 </reserved3>
  3229.         <reserved2> 0 </reserved2>
  3230.         <reserved1> 0 </reserved1>
  3231.         <enabled> <true /> </enabled>
  3232.         <rect>
  3233.             <left>170</left>
  3234.             <top>62</top>
  3235.             <right>339</right>
  3236.             <bottom>84</bottom>
  3237.         </rect>
  3238.         <style>rectangle</style>
  3239.         <showName> <true /> </showName>
  3240.         <highlight> <false /> </highlight>
  3241.         <autoHighlight> <false /> </autoHighlight>
  3242.         <sharedHighlight> <true /> </sharedHighlight>
  3243.         <family>0</family>
  3244.         <titleWidth>0</titleWidth>
  3245.         <icon>0</icon>
  3246.         <textAlign>center</textAlign>
  3247.         <font>Chicago</font>
  3248.         <textSize>12</textSize>
  3249.         <textStyle>plain</textStyle>
  3250.         <name>Enter ID of desired card</name>
  3251.         <script></script>
  3252.     </part>
  3253.     <part>
  3254.         <id>127</id>
  3255.         <type>field</type>
  3256.         <visible> <false /> </visible>
  3257.         <dontWrap> <false /> </dontWrap>
  3258.         <dontSearch> <false /> </dontSearch>
  3259.         <sharedText> <false /> </sharedText>
  3260.         <fixedLineHeight> <true /> </fixedLineHeight>
  3261.         <autoTab> <false /> </autoTab>
  3262.         <lockText> <true /> </lockText>
  3263.         <rect>
  3264.             <left>156</left>
  3265.             <top>120</top>
  3266.             <right>356</right>
  3267.             <bottom>205</bottom>
  3268.         </rect>
  3269.         <style>shadow</style>
  3270.         <autoSelect> <false /> </autoSelect>
  3271.         <showLines> <false /> </showLines>
  3272.         <wideMargins> <false /> </wideMargins>
  3273.         <multipleLines> <false /> </multipleLines>
  3274.         <reservedFamily> 0 </reservedFamily>
  3275.         <titleWidth>0</titleWidth>
  3276.         <icon>0</icon>
  3277.         <textAlign>left</textAlign>
  3278.         <font>Palatino</font>
  3279.         <textSize>12</textSize>
  3280.         <textStyle>plain</textStyle>
  3281.         <textHeight>16</textHeight>
  3282.         <name>updating</name>
  3283.         <script></script>
  3284.     </part>
  3285.     <part>
  3286.         <id>129</id>
  3287.         <type>button</type>
  3288.         <visible> <true /> </visible>
  3289.         <reserved5> 0 </reserved5>
  3290.         <reserved4> 0 </reserved4>
  3291.         <reserved3> 0 </reserved3>
  3292.         <reserved2> 0 </reserved2>
  3293.         <reserved1> 0 </reserved1>
  3294.         <enabled> <true /> </enabled>
  3295.         <rect>
  3296.             <left>453</left>
  3297.             <top>313</top>
  3298.             <right>480</right>
  3299.             <bottom>338</bottom>
  3300.         </rect>
  3301.         <style>transparent</style>
  3302.         <showName> <false /> </showName>
  3303.         <highlight> <false /> </highlight>
  3304.         <autoHighlight> <false /> </autoHighlight>
  3305.         <sharedHighlight> <true /> </sharedHighlight>
  3306.         <family>0</family>
  3307.         <titleWidth>0</titleWidth>
  3308.         <icon>0</icon>
  3309.         <textAlign>center</textAlign>
  3310.         <font>Chicago</font>
  3311.         <textSize>12</textSize>
  3312.         <textStyle>plain</textStyle>
  3313.         <name></name>
  3314.         <script>on mouseUp
  3315. beep
  3316. end mouseUp
  3317.  
  3318. </script>
  3319.     </part>
  3320.     <part>
  3321.         <id>141</id>
  3322.         <type>field</type>
  3323.         <visible> <false /> </visible>
  3324.         <dontWrap> <false /> </dontWrap>
  3325.         <dontSearch> <false /> </dontSearch>
  3326.         <sharedText> <false /> </sharedText>
  3327.         <fixedLineHeight> <true /> </fixedLineHeight>
  3328.         <autoTab> <false /> </autoTab>
  3329.         <lockText> <false /> </lockText>
  3330.         <rect>
  3331.             <left>69</left>
  3332.             <top>311</top>
  3333.             <right>220</right>
  3334.             <bottom>330</bottom>
  3335.         </rect>
  3336.         <style>opaque</style>
  3337.         <autoSelect> <false /> </autoSelect>
  3338.         <showLines> <false /> </showLines>
  3339.         <wideMargins> <false /> </wideMargins>
  3340.         <multipleLines> <false /> </multipleLines>
  3341.         <reservedFamily> 0 </reservedFamily>
  3342.         <titleWidth>0</titleWidth>
  3343.         <icon>0</icon>
  3344.         <textAlign>left</textAlign>
  3345.         <font>Palatino</font>
  3346.         <textSize>12</textSize>
  3347.         <textStyle>plain</textStyle>
  3348.         <textHeight>16</textHeight>
  3349.         <name>deletedCard</name>
  3350.         <script></script>
  3351.     </part>
  3352.     <part>
  3353.         <id>153</id>
  3354.         <type>button</type>
  3355.         <visible> <true /> </visible>
  3356.         <reserved5> 0 </reserved5>
  3357.         <reserved4> 0 </reserved4>
  3358.         <reserved3> 0 </reserved3>
  3359.         <reserved2> 0 </reserved2>
  3360.         <reserved1> 0 </reserved1>
  3361.         <enabled> <true /> </enabled>
  3362.         <rect>
  3363.             <left>367</left>
  3364.             <top>32</top>
  3365.             <right>467</right>
  3366.             <bottom>54</bottom>
  3367.         </rect>
  3368.         <style>roundrect</style>
  3369.         <showName> <true /> </showName>
  3370.         <highlight> <false /> </highlight>
  3371.         <autoHighlight> <true /> </autoHighlight>
  3372.         <sharedHighlight> <true /> </sharedHighlight>
  3373.         <family>0</family>
  3374.         <titleWidth>0</titleWidth>
  3375.         <icon>0</icon>
  3376.         <textAlign>center</textAlign>
  3377.         <font>Chicago</font>
  3378.         <textSize>12</textSize>
  3379.         <textStyle>plain</textStyle>
  3380.         <name>Find...</name>
  3381.         <script>on mouseUp
  3382. doMenu "Find..."
  3383. end mouseUp
  3384. </script>
  3385.     </part>
  3386.     <content>
  3387.         <layer>background</layer>
  3388.         <id>7</id>
  3389.         <text>2</text>
  3390.     </content>
  3391.     <content>
  3392.         <layer>card</layer>
  3393.         <id>14</id>
  3394.         <text>0</text>
  3395.     </content>
  3396.     <content>
  3397.         <layer>background</layer>
  3398.         <id>6</id>
  3399.         <text>Contents</text>
  3400.     </content>
  3401.     <content>
  3402.         <layer>card</layer>
  3403.         <id>20</id>
  3404.         <text>(click on the topic or page no. of interest)</text>
  3405.     </content>
  3406.     <content>
  3407.         <layer>background</layer>
  3408.         <id>4</id>
  3409.         <text>
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427. </text>
  3428.     </content>
  3429.     <content>
  3430.         <layer>card</layer>
  3431.         <id>24</id>
  3432.         <text>0</text>
  3433.     </content>
  3434.     <content>
  3435.         <layer>card</layer>
  3436.         <id>25</id>
  3437.         <text>0</text>
  3438.     </content>
  3439.     <content>
  3440.         <layer>card</layer>
  3441.         <id>123</id>
  3442.         <text>9925
  3443.  
  3444. 3971
  3445.  
  3446. 7205
  3447.     4342
  3448.     2542
  3449.     19225
  3450.  
  3451. 6753
  3452.     22558
  3453.     20555
  3454.     22415
  3455.     20884
  3456.     20338
  3457.     22999
  3458.  
  3459. 8539
  3460.     12248
  3461.     26691
  3462.     31005
  3463.     9318
  3464.     33872
  3465.     34369
  3466.     31462
  3467.     7960
  3468.  
  3469. 8871
  3470.     36058
  3471.     37143
  3472.     43887
  3473.     43696
  3474.     68970
  3475.     42427
  3476.     40553
  3477.     38494
  3478. 9080
  3479.     44454
  3480.     44647
  3481.     44917
  3482.     45309
  3483.  
  3484. 21180
  3485.     48179
  3486.     48576
  3487.     48901
  3488.     49349
  3489.     49620
  3490.  
  3491. 21485
  3492.     51878
  3493.     52189
  3494.     52411
  3495.  
  3496. 21751
  3497.     33614
  3498.     34612
  3499.     34876
  3500.     35106
  3501.  
  3502. 23089
  3503.     60165
  3504.     61284
  3505.     62767
  3506.  
  3507. 3295
  3508. 12288
  3509.  
  3510. 2231
  3511.  
  3512. 6390
  3513.  
  3514.  
  3515. 29372
  3516.  
  3517. 5118
  3518.  
  3519. 29601
  3520.  
  3521. 30088
  3522.  
  3523. 40835
  3524.  
  3525. 66370
  3526.  
  3527. 30418
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595. </text>
  3596.     </content>
  3597.     <content>
  3598.         <layer>card</layer>
  3599.         <id>37</id>
  3600.         <text>15</text>
  3601.     </content>
  3602.     <content>
  3603.         <layer>card</layer>
  3604.         <id>36</id>
  3605.         <text>1.  Introduction</text>
  3606.     </content>
  3607.     <content>
  3608.         <layer>card</layer>
  3609.         <id>39</id>
  3610.         <text>18</text>
  3611.     </content>
  3612.     <content>
  3613.         <layer>card</layer>
  3614.         <id>38</id>
  3615.         <text>    1.1  The Person Program</text>
  3616.     </content>
  3617.     <content>
  3618.         <layer>card</layer>
  3619.         <id>50</id>
  3620.         <text>55</text>
  3621.     </content>
  3622.     <content>
  3623.         <layer>card</layer>
  3624.         <id>49</id>
  3625.         <text>2.  Data Types</text>
  3626.     </content>
  3627.     <content>
  3628.         <layer>card</layer>
  3629.         <id>52</id>
  3630.         <text>56</text>
  3631.     </content>
  3632.     <content>
  3633.         <layer>card</layer>
  3634.         <id>51</id>
  3635.         <text>    2.1  Basic Types</text>
  3636.     </content>
  3637.     <content>
  3638.         <layer>card</layer>
  3639.         <id>127</id>
  3640.         <text>Updating Table of Contents.
  3641. Please wait...</text>
  3642.     </content>
  3643.     <content>
  3644.         <layer>card</layer>
  3645.         <id>58</id>
  3646.         <text>74</text>
  3647.     </content>
  3648.     <content>
  3649.         <layer>card</layer>
  3650.         <id>57</id>
  3651.         <text>    2.4  User-Defined Types</text>
  3652.     </content>
  3653.     <content>
  3654.         <layer>card</layer>
  3655.         <id>54</id>
  3656.         <text>64</text>
  3657.     </content>
  3658.     <content>
  3659.         <layer>card</layer>
  3660.         <id>53</id>
  3661.         <text>    2.2  Pointers</text>
  3662.     </content>
  3663.     <content>
  3664.         <layer>card</layer>
  3665.         <id>56</id>
  3666.         <text>68</text>
  3667.     </content>
  3668.     <content>
  3669.         <layer>card</layer>
  3670.         <id>55</id>
  3671.         <text>    2.3  Arrays</text>
  3672.     </content>
  3673.     <content>
  3674.         <layer>card</layer>
  3675.         <id>66</id>
  3676.         <text>93</text>
  3677.     </content>
  3678.     <content>
  3679.         <layer>card</layer>
  3680.         <id>65</id>
  3681.         <text>3.  Functions  
  3682. </text>
  3683.     </content>
  3684.     <content>
  3685.         <layer>card</layer>
  3686.         <id>84</id>
  3687.         <text>94</text>
  3688.     </content>
  3689.     <content>
  3690.         <layer>card</layer>
  3691.         <id>85</id>
  3692.         <text>    3.1  Prototypes</text>
  3693.     </content>
  3694.     <content>
  3695.         <layer>card</layer>
  3696.         <id>94</id>
  3697.         <text>106</text>
  3698.     </content>
  3699.     <content>
  3700.         <layer>card</layer>
  3701.         <id>93</id>
  3702.         <text>    3.4  The main() Function</text>
  3703.     </content>
  3704.     <content>
  3705.         <layer>card</layer>
  3706.         <id>90</id>
  3707.         <text>97</text>
  3708.     </content>
  3709.     <content>
  3710.         <layer>card</layer>
  3711.         <id>89</id>
  3712.         <text>    3.2  Function Calls</text>
  3713.     </content>
  3714.     <content>
  3715.         <layer>card</layer>
  3716.         <id>108</id>
  3717.         <text>116</text>
  3718.     </content>
  3719.     <content>
  3720.         <layer>card</layer>
  3721.         <id>107</id>
  3722.         <text>    4.1  Classes & Methods</text>
  3723.     </content>
  3724.     <content>
  3725.         <layer>card</layer>
  3726.         <id>112</id>
  3727.         <text>128</text>
  3728.     </content>
  3729.     <content>
  3730.         <layer>card</layer>
  3731.         <id>111</id>
  3732.         <text>    4.3  Virtual Methods and Typing</text>
  3733.     </content>
  3734.     <content>
  3735.         <layer>card</layer>
  3736.         <id>92</id>
  3737.         <text>103</text>
  3738.     </content>
  3739.     <content>
  3740.         <layer>card</layer>
  3741.         <id>91</id>
  3742.         <text>    3.3  Scope</text>
  3743.     </content>
  3744.     <content>
  3745.         <layer>card</layer>
  3746.         <id>98</id>
  3747.         <text>108</text>
  3748.     </content>
  3749.     <content>
  3750.         <layer>card</layer>
  3751.         <id>97</id>
  3752.         <text>    3.6  Function Pointers</text>
  3753.     </content>
  3754.     <content>
  3755.         <layer>card</layer>
  3756.         <id>96</id>
  3757.         <text>107</text>
  3758.     </content>
  3759.     <content>
  3760.         <layer>card</layer>
  3761.         <id>95</id>
  3762.         <text>    3.5  Recursion</text>
  3763.     </content>
  3764.     <content>
  3765.         <layer>card</layer>
  3766.         <id>106</id>
  3767.         <text>115</text>
  3768.     </content>
  3769.     <content>
  3770.         <layer>card</layer>
  3771.         <id>105</id>
  3772.         <text>4.  Classes & Program Structure </text>
  3773.     </content>
  3774.     <content>
  3775.         <layer>card</layer>
  3776.         <id>110</id>
  3777.         <text>122</text>
  3778.     </content>
  3779.     <content>
  3780.         <layer>card</layer>
  3781.         <id>109</id>
  3782.         <text>    4.2  Objects & Messages</text>
  3783.     </content>
  3784.     <content>
  3785.         <layer>card</layer>
  3786.         <id>122</id>
  3787.         <text>158</text>
  3788.     </content>
  3789.     <content>
  3790.         <layer>card</layer>
  3791.         <id>121</id>
  3792.         <text>    4.8  TC Indirect & Direct Objects</text>
  3793.     </content>
  3794.     <content>
  3795.         <layer>card</layer>
  3796.         <id>120</id>
  3797.         <text>154</text>
  3798.     </content>
  3799.     <content>
  3800.         <layer>card</layer>
  3801.         <id>119</id>
  3802.         <text>    4.7  More C++ Features</text>
  3803.     </content>
  3804.     <content>
  3805.         <layer>card</layer>
  3806.         <id>29</id>
  3807.         <text>4</text>
  3808.     </content>
  3809.     <content>
  3810.         <layer>card</layer>
  3811.         <id>28</id>
  3812.         <text>List of Code Examples</text>
  3813.     </content>
  3814.     <content>
  3815.         <layer>card</layer>
  3816.         <id>33</id>
  3817.         <text>5</text>
  3818.     </content>
  3819.     <content>
  3820.         <layer>card</layer>
  3821.         <id>32</id>
  3822.         <text>Preface</text>
  3823.     </content>
  3824.     <content>
  3825.         <layer>card</layer>
  3826.         <id>46</id>
  3827.         <text>53</text>
  3828.     </content>
  3829.     <content>
  3830.         <layer>card</layer>
  3831.         <id>45</id>
  3832.         <text>    1.3  OOP Benefits</text>
  3833.     </content>
  3834.     <content>
  3835.         <layer>card</layer>
  3836.         <id>62</id>
  3837.         <text>91</text>
  3838.     </content>
  3839.     <content>
  3840.         <layer>card</layer>
  3841.         <id>61</id>
  3842.         <text>    2.6  Example</text>
  3843.     </content>
  3844.     <content>
  3845.         <layer>card</layer>
  3846.         <id>102</id>
  3847.         <text>112</text>
  3848.     </content>
  3849.     <content>
  3850.         <layer>card</layer>
  3851.         <id>101</id>
  3852.         <text>    3.8  Example</text>
  3853.     </content>
  3854.     <content>
  3855.         <layer>card</layer>
  3856.         <id>116</id>
  3857.         <text>138</text>
  3858.     </content>
  3859.     <content>
  3860.         <layer>card</layer>
  3861.         <id>115</id>
  3862.         <text>    4.5  Access Specifiers</text>
  3863.     </content>
  3864.     <content>
  3865.         <layer>card</layer>
  3866.         <id>44</id>
  3867.         <text>41</text>
  3868.     </content>
  3869.     <content>
  3870.         <layer>card</layer>
  3871.         <id>43</id>
  3872.         <text>    1.2  Inheritance & Polymorphism</text>
  3873.     </content>
  3874.     <content>
  3875.         <layer>card</layer>
  3876.         <id>60</id>
  3877.         <text>84</text>
  3878.     </content>
  3879.     <content>
  3880.         <layer>card</layer>
  3881.         <id>59</id>
  3882.         <text>    2.5  Scope & Storage Class</text>
  3883.     </content>
  3884.     <content>
  3885.         <layer>card</layer>
  3886.         <id>100</id>
  3887.         <text>110</text>
  3888.     </content>
  3889.     <content>
  3890.         <layer>card</layer>
  3891.         <id>99</id>
  3892.         <text>    3.7  Library Functions</text>
  3893.     </content>
  3894.     <content>
  3895.         <layer>card</layer>
  3896.         <id>114</id>
  3897.         <text>133</text>
  3898.     </content>
  3899.     <content>
  3900.         <layer>card</layer>
  3901.         <id>113</id>
  3902.         <text>    4.4  Constructors & Destructors</text>
  3903.     </content>
  3904.     <content>
  3905.         <layer>card</layer>
  3906.         <id>118</id>
  3907.         <text>143</text>
  3908.     </content>
  3909.     <content>
  3910.         <layer>card</layer>
  3911.         <id>117</id>
  3912.         <text>    4.6  Example & Documentation</text>
  3913.     </content>
  3914.     <name>contents</name>
  3915.     <script>on openCard
  3916. if the lockScreen is false then
  3917. global xrefdepth
  3918. put 0 into xrefdepth
  3919. hide background button "return"
  3920. end if
  3921. pass openCard
  3922. end openCard
  3923.  
  3924. on updateContents
  3925. global deletedCard
  3926. set cursor to watch
  3927. put 4 into firstField
  3928. repeat with x = 1 to 36
  3929. get line x of card field "content list" of card "contents"
  3930. if it is word 3 of deletedCard then
  3931. put "" into line x of card field "content list" of card "contents"
  3932. get ""
  3933. end if
  3934. if it is "" then
  3935. put "" into card field (2*x+firstField) of card (the number of me)
  3936. put "" into card field (2*x-1+firstField) of card (the number of me)
  3937. else
  3938. put the number of card id it into card field (2*x-1+firstField)¬¨
  3939. of card (the number of me)
  3940. put it into card field (2*x+firstField) of card (the number of me)
  3941. get field "heading" of card id it
  3942. put it into word 1 of card field (2*x+firstField)¬¨
  3943. of card (the number of me)
  3944. end if
  3945. end repeat
  3946. put (the number of me) + 1 into nextCard
  3947. get the name of card nextCard
  3948. get word 2 of it
  3949. get char 2 to 9 of it
  3950. if it is "contents" then
  3951. send updateContents to card nextCard
  3952. end if
  3953. end updateContents
  3954.  
  3955. </script>
  3956. </card>
  3957.  
  3958.  
  3959. card_8278.xml
  3960. <?xml version="1.0" encoding="utf-8" ?>
  3961. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  3962. <card>
  3963.     <id>8278</id>
  3964.     <filler1>0</filler1>
  3965.     <cantDelete> <true /> </cantDelete>
  3966.     <showPict> <true /> </showPict>
  3967.     <dontSearch> <false /> </dontSearch>
  3968.     <owner>4755</owner>
  3969.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  3970.     <part>
  3971.         <id>26</id>
  3972.         <type>button</type>
  3973.         <visible> <true /> </visible>
  3974.         <reserved5> 0 </reserved5>
  3975.         <reserved4> 0 </reserved4>
  3976.         <reserved3> 0 </reserved3>
  3977.         <reserved2> 0 </reserved2>
  3978.         <reserved1> 0 </reserved1>
  3979.         <enabled> <true /> </enabled>
  3980.         <rect>
  3981.             <left>7</left>
  3982.             <top>57</top>
  3983.             <right>502</right>
  3984.             <bottom>300</bottom>
  3985.         </rect>
  3986.         <style>transparent</style>
  3987.         <showName> <false /> </showName>
  3988.         <highlight> <false /> </highlight>
  3989.         <autoHighlight> <false /> </autoHighlight>
  3990.         <sharedHighlight> <true /> </sharedHighlight>
  3991.         <family>0</family>
  3992.         <titleWidth>0</titleWidth>
  3993.         <icon>0</icon>
  3994.         <textAlign>center</textAlign>
  3995.         <font>Chicago</font>
  3996.         <textSize>12</textSize>
  3997.         <textStyle>plain</textStyle>
  3998.         <name></name>
  3999.         <script></script>
  4000.     </part>
  4001.     <part>
  4002.         <id>14</id>
  4003.         <type>field</type>
  4004.         <visible> <false /> </visible>
  4005.         <dontWrap> <false /> </dontWrap>
  4006.         <dontSearch> <false /> </dontSearch>
  4007.         <sharedText> <false /> </sharedText>
  4008.         <fixedLineHeight> <true /> </fixedLineHeight>
  4009.         <autoTab> <false /> </autoTab>
  4010.         <lockText> <false /> </lockText>
  4011.         <rect>
  4012.             <left>141</left>
  4013.             <top>21</top>
  4014.             <right>237</right>
  4015.             <bottom>36</bottom>
  4016.         </rect>
  4017.         <style>transparent</style>
  4018.         <autoSelect> <false /> </autoSelect>
  4019.         <showLines> <false /> </showLines>
  4020.         <wideMargins> <false /> </wideMargins>
  4021.         <multipleLines> <false /> </multipleLines>
  4022.         <reservedFamily> 0 </reservedFamily>
  4023.         <titleWidth>0</titleWidth>
  4024.         <icon>0</icon>
  4025.         <textAlign>left</textAlign>
  4026.         <font>Palatino</font>
  4027.         <textSize>12</textSize>
  4028.         <textStyle>plain</textStyle>
  4029.         <textHeight>16</textHeight>
  4030.         <name>bookmark1</name>
  4031.         <script></script>
  4032.     </part>
  4033.     <part>
  4034.         <id>20</id>
  4035.         <type>field</type>
  4036.         <visible> <true /> </visible>
  4037.         <dontWrap> <false /> </dontWrap>
  4038.         <dontSearch> <false /> </dontSearch>
  4039.         <sharedText> <false /> </sharedText>
  4040.         <fixedLineHeight> <true /> </fixedLineHeight>
  4041.         <autoTab> <false /> </autoTab>
  4042.         <lockText> <true /> </lockText>
  4043.         <rect>
  4044.             <left>118</left>
  4045.             <top>37</top>
  4046.             <right>355</right>
  4047.             <bottom>55</bottom>
  4048.         </rect>
  4049.         <style>transparent</style>
  4050.         <autoSelect> <false /> </autoSelect>
  4051.         <showLines> <false /> </showLines>
  4052.         <wideMargins> <false /> </wideMargins>
  4053.         <multipleLines> <false /> </multipleLines>
  4054.         <reservedFamily> 0 </reservedFamily>
  4055.         <titleWidth>0</titleWidth>
  4056.         <icon>0</icon>
  4057.         <textAlign>left</textAlign>
  4058.         <font>Palatino</font>
  4059.         <textSize>10</textSize>
  4060.         <textStyle>plain</textStyle>
  4061.         <textHeight>13</textHeight>
  4062.         <name>instructions</name>
  4063.         <script></script>
  4064.     </part>
  4065.     <part>
  4066.         <id>24</id>
  4067.         <type>field</type>
  4068.         <visible> <false /> </visible>
  4069.         <dontWrap> <false /> </dontWrap>
  4070.         <dontSearch> <false /> </dontSearch>
  4071.         <sharedText> <false /> </sharedText>
  4072.         <fixedLineHeight> <true /> </fixedLineHeight>
  4073.         <autoTab> <false /> </autoTab>
  4074.         <lockText> <false /> </lockText>
  4075.         <rect>
  4076.             <left>237</left>
  4077.             <top>21</top>
  4078.             <right>333</right>
  4079.             <bottom>36</bottom>
  4080.         </rect>
  4081.         <style>transparent</style>
  4082.         <autoSelect> <false /> </autoSelect>
  4083.         <showLines> <false /> </showLines>
  4084.         <wideMargins> <false /> </wideMargins>
  4085.         <multipleLines> <false /> </multipleLines>
  4086.         <reservedFamily> 0 </reservedFamily>
  4087.         <titleWidth>0</titleWidth>
  4088.         <icon>0</icon>
  4089.         <textAlign>left</textAlign>
  4090.         <font>Palatino</font>
  4091.         <textSize>12</textSize>
  4092.         <textStyle>plain</textStyle>
  4093.         <textHeight>16</textHeight>
  4094.         <name>bookmark2</name>
  4095.         <script></script>
  4096.     </part>
  4097.     <part>
  4098.         <id>25</id>
  4099.         <type>field</type>
  4100.         <visible> <false /> </visible>
  4101.         <dontWrap> <false /> </dontWrap>
  4102.         <dontSearch> <false /> </dontSearch>
  4103.         <sharedText> <false /> </sharedText>
  4104.         <fixedLineHeight> <true /> </fixedLineHeight>
  4105.         <autoTab> <false /> </autoTab>
  4106.         <lockText> <false /> </lockText>
  4107.         <rect>
  4108.             <left>333</left>
  4109.             <top>21</top>
  4110.             <right>429</right>
  4111.             <bottom>36</bottom>
  4112.         </rect>
  4113.         <style>transparent</style>
  4114.         <autoSelect> <false /> </autoSelect>
  4115.         <showLines> <false /> </showLines>
  4116.         <wideMargins> <false /> </wideMargins>
  4117.         <multipleLines> <false /> </multipleLines>
  4118.         <reservedFamily> 0 </reservedFamily>
  4119.         <titleWidth>0</titleWidth>
  4120.         <icon>0</icon>
  4121.         <textAlign>left</textAlign>
  4122.         <font>Palatino</font>
  4123.         <textSize>12</textSize>
  4124.         <textStyle>plain</textStyle>
  4125.         <textHeight>16</textHeight>
  4126.         <name>bookmark3</name>
  4127.         <script></script>
  4128.     </part>
  4129.     <part>
  4130.         <id>29</id>
  4131.         <type>field</type>
  4132.         <visible> <true /> </visible>
  4133.         <dontWrap> <false /> </dontWrap>
  4134.         <dontSearch> <false /> </dontSearch>
  4135.         <sharedText> <false /> </sharedText>
  4136.         <fixedLineHeight> <true /> </fixedLineHeight>
  4137.         <autoTab> <false /> </autoTab>
  4138.         <lockText> <true /> </lockText>
  4139.         <rect>
  4140.             <left>190</left>
  4141.             <top>60</top>
  4142.             <right>233</right>
  4143.             <bottom>74</bottom>
  4144.         </rect>
  4145.         <style>transparent</style>
  4146.         <autoSelect> <false /> </autoSelect>
  4147.         <showLines> <false /> </showLines>
  4148.         <wideMargins> <false /> </wideMargins>
  4149.         <multipleLines> <false /> </multipleLines>
  4150.         <reservedFamily> 0 </reservedFamily>
  4151.         <titleWidth>0</titleWidth>
  4152.         <icon>0</icon>
  4153.         <textAlign>right</textAlign>
  4154.         <font>Palatino</font>
  4155.         <textSize>10</textSize>
  4156.         <textStyle>plain</textStyle>
  4157.         <textHeight>13</textHeight>
  4158.         <name></name>
  4159.         <script></script>
  4160.     </part>
  4161.     <part>
  4162.         <id>28</id>
  4163.         <type>field</type>
  4164.         <visible> <true /> </visible>
  4165.         <dontWrap> <false /> </dontWrap>
  4166.         <dontSearch> <false /> </dontSearch>
  4167.         <sharedText> <false /> </sharedText>
  4168.         <fixedLineHeight> <true /> </fixedLineHeight>
  4169.         <autoTab> <false /> </autoTab>
  4170.         <lockText> <true /> </lockText>
  4171.         <rect>
  4172.             <left>14</left>
  4173.             <top>60</top>
  4174.             <right>233</right>
  4175.             <bottom>74</bottom>
  4176.         </rect>
  4177.         <style>transparent</style>
  4178.         <autoSelect> <false /> </autoSelect>
  4179.         <showLines> <false /> </showLines>
  4180.         <wideMargins> <false /> </wideMargins>
  4181.         <multipleLines> <false /> </multipleLines>
  4182.         <reservedFamily> 0 </reservedFamily>
  4183.         <titleWidth>0</titleWidth>
  4184.         <icon>0</icon>
  4185.         <textAlign>left</textAlign>
  4186.         <font>Palatino</font>
  4187.         <textSize>10</textSize>
  4188.         <textStyle>plain</textStyle>
  4189.         <textHeight>13</textHeight>
  4190.         <name></name>
  4191.         <script>on mouseUp
  4192. visual iris open
  4193. get the number of the target
  4194. get card field (it-1)
  4195. if it is not "" then
  4196. go card it
  4197. end if
  4198. end mouseUp
  4199. </script>
  4200.     </part>
  4201.     <part>
  4202.         <id>31</id>
  4203.         <type>field</type>
  4204.         <visible> <true /> </visible>
  4205.         <dontWrap> <false /> </dontWrap>
  4206.         <dontSearch> <false /> </dontSearch>
  4207.         <sharedText> <false /> </sharedText>
  4208.         <fixedLineHeight> <true /> </fixedLineHeight>
  4209.         <autoTab> <false /> </autoTab>
  4210.         <lockText> <true /> </lockText>
  4211.         <rect>
  4212.             <left>190</left>
  4213.             <top>73</top>
  4214.             <right>233</right>
  4215.             <bottom>87</bottom>
  4216.         </rect>
  4217.         <style>transparent</style>
  4218.         <autoSelect> <false /> </autoSelect>
  4219.         <showLines> <false /> </showLines>
  4220.         <wideMargins> <false /> </wideMargins>
  4221.         <multipleLines> <false /> </multipleLines>
  4222.         <reservedFamily> 0 </reservedFamily>
  4223.         <titleWidth>0</titleWidth>
  4224.         <icon>0</icon>
  4225.         <textAlign>right</textAlign>
  4226.         <font>Palatino</font>
  4227.         <textSize>10</textSize>
  4228.         <textStyle>plain</textStyle>
  4229.         <textHeight>13</textHeight>
  4230.         <name></name>
  4231.         <script></script>
  4232.     </part>
  4233.     <part>
  4234.         <id>30</id>
  4235.         <type>field</type>
  4236.         <visible> <true /> </visible>
  4237.         <dontWrap> <false /> </dontWrap>
  4238.         <dontSearch> <false /> </dontSearch>
  4239.         <sharedText> <false /> </sharedText>
  4240.         <fixedLineHeight> <true /> </fixedLineHeight>
  4241.         <autoTab> <false /> </autoTab>
  4242.         <lockText> <true /> </lockText>
  4243.         <rect>
  4244.             <left>14</left>
  4245.             <top>73</top>
  4246.             <right>233</right>
  4247.             <bottom>87</bottom>
  4248.         </rect>
  4249.         <style>transparent</style>
  4250.         <autoSelect> <false /> </autoSelect>
  4251.         <showLines> <false /> </showLines>
  4252.         <wideMargins> <false /> </wideMargins>
  4253.         <multipleLines> <false /> </multipleLines>
  4254.         <reservedFamily> 0 </reservedFamily>
  4255.         <titleWidth>0</titleWidth>
  4256.         <icon>0</icon>
  4257.         <textAlign>left</textAlign>
  4258.         <font>Palatino</font>
  4259.         <textSize>10</textSize>
  4260.         <textStyle>plain</textStyle>
  4261.         <textHeight>13</textHeight>
  4262.         <name></name>
  4263.         <script>on mouseUp
  4264. visual iris open
  4265. get the number of the target
  4266. get card field (it-1)
  4267. if it is not "" then
  4268. go card it
  4269. end if
  4270. end mouseUp
  4271. </script>
  4272.     </part>
  4273.     <part>
  4274.         <id>33</id>
  4275.         <type>field</type>
  4276.         <visible> <true /> </visible>
  4277.         <dontWrap> <false /> </dontWrap>
  4278.         <dontSearch> <false /> </dontSearch>
  4279.         <sharedText> <false /> </sharedText>
  4280.         <fixedLineHeight> <true /> </fixedLineHeight>
  4281.         <autoTab> <false /> </autoTab>
  4282.         <lockText> <true /> </lockText>
  4283.         <rect>
  4284.             <left>190</left>
  4285.             <top>86</top>
  4286.             <right>233</right>
  4287.             <bottom>100</bottom>
  4288.         </rect>
  4289.         <style>transparent</style>
  4290.         <autoSelect> <false /> </autoSelect>
  4291.         <showLines> <false /> </showLines>
  4292.         <wideMargins> <false /> </wideMargins>
  4293.         <multipleLines> <false /> </multipleLines>
  4294.         <reservedFamily> 0 </reservedFamily>
  4295.         <titleWidth>0</titleWidth>
  4296.         <icon>0</icon>
  4297.         <textAlign>right</textAlign>
  4298.         <font>Palatino</font>
  4299.         <textSize>10</textSize>
  4300.         <textStyle>plain</textStyle>
  4301.         <textHeight>13</textHeight>
  4302.         <name></name>
  4303.         <script></script>
  4304.     </part>
  4305.     <part>
  4306.         <id>32</id>
  4307.         <type>field</type>
  4308.         <visible> <true /> </visible>
  4309.         <dontWrap> <false /> </dontWrap>
  4310.         <dontSearch> <false /> </dontSearch>
  4311.         <sharedText> <false /> </sharedText>
  4312.         <fixedLineHeight> <true /> </fixedLineHeight>
  4313.         <autoTab> <false /> </autoTab>
  4314.         <lockText> <true /> </lockText>
  4315.         <rect>
  4316.             <left>14</left>
  4317.             <top>86</top>
  4318.             <right>233</right>
  4319.             <bottom>100</bottom>
  4320.         </rect>
  4321.         <style>transparent</style>
  4322.         <autoSelect> <false /> </autoSelect>
  4323.         <showLines> <false /> </showLines>
  4324.         <wideMargins> <false /> </wideMargins>
  4325.         <multipleLines> <false /> </multipleLines>
  4326.         <reservedFamily> 0 </reservedFamily>
  4327.         <titleWidth>0</titleWidth>
  4328.         <icon>0</icon>
  4329.         <textAlign>left</textAlign>
  4330.         <font>Palatino</font>
  4331.         <textSize>10</textSize>
  4332.         <textStyle>plain</textStyle>
  4333.         <textHeight>13</textHeight>
  4334.         <name></name>
  4335.         <script>on mouseUp
  4336. visual iris open
  4337. get the number of the target
  4338. get card field (it-1)
  4339. if it is not "" then
  4340. go card it
  4341. end if
  4342. end mouseUp
  4343. </script>
  4344.     </part>
  4345.     <part>
  4346.         <id>35</id>
  4347.         <type>field</type>
  4348.         <visible> <true /> </visible>
  4349.         <dontWrap> <false /> </dontWrap>
  4350.         <dontSearch> <false /> </dontSearch>
  4351.         <sharedText> <false /> </sharedText>
  4352.         <fixedLineHeight> <true /> </fixedLineHeight>
  4353.         <autoTab> <false /> </autoTab>
  4354.         <lockText> <true /> </lockText>
  4355.         <rect>
  4356.             <left>190</left>
  4357.             <top>99</top>
  4358.             <right>233</right>
  4359.             <bottom>113</bottom>
  4360.         </rect>
  4361.         <style>transparent</style>
  4362.         <autoSelect> <false /> </autoSelect>
  4363.         <showLines> <false /> </showLines>
  4364.         <wideMargins> <false /> </wideMargins>
  4365.         <multipleLines> <false /> </multipleLines>
  4366.         <reservedFamily> 0 </reservedFamily>
  4367.         <titleWidth>0</titleWidth>
  4368.         <icon>0</icon>
  4369.         <textAlign>right</textAlign>
  4370.         <font>Palatino</font>
  4371.         <textSize>10</textSize>
  4372.         <textStyle>plain</textStyle>
  4373.         <textHeight>13</textHeight>
  4374.         <name></name>
  4375.         <script></script>
  4376.     </part>
  4377.     <part>
  4378.         <id>34</id>
  4379.         <type>field</type>
  4380.         <visible> <true /> </visible>
  4381.         <dontWrap> <false /> </dontWrap>
  4382.         <dontSearch> <false /> </dontSearch>
  4383.         <sharedText> <false /> </sharedText>
  4384.         <fixedLineHeight> <true /> </fixedLineHeight>
  4385.         <autoTab> <false /> </autoTab>
  4386.         <lockText> <true /> </lockText>
  4387.         <rect>
  4388.             <left>14</left>
  4389.             <top>99</top>
  4390.             <right>233</right>
  4391.             <bottom>113</bottom>
  4392.         </rect>
  4393.         <style>transparent</style>
  4394.         <autoSelect> <false /> </autoSelect>
  4395.         <showLines> <false /> </showLines>
  4396.         <wideMargins> <false /> </wideMargins>
  4397.         <multipleLines> <false /> </multipleLines>
  4398.         <reservedFamily> 0 </reservedFamily>
  4399.         <titleWidth>0</titleWidth>
  4400.         <icon>0</icon>
  4401.         <textAlign>left</textAlign>
  4402.         <font>Palatino</font>
  4403.         <textSize>10</textSize>
  4404.         <textStyle>plain</textStyle>
  4405.         <textHeight>13</textHeight>
  4406.         <name></name>
  4407.         <script>on mouseUp
  4408. visual iris open
  4409. get the number of the target
  4410. get card field (it-1)
  4411. if it is not "" then
  4412. go card it
  4413. end if
  4414. end mouseUp
  4415. </script>
  4416.     </part>
  4417.     <part>
  4418.         <id>37</id>
  4419.         <type>field</type>
  4420.         <visible> <true /> </visible>
  4421.         <dontWrap> <false /> </dontWrap>
  4422.         <dontSearch> <false /> </dontSearch>
  4423.         <sharedText> <false /> </sharedText>
  4424.         <fixedLineHeight> <true /> </fixedLineHeight>
  4425.         <autoTab> <false /> </autoTab>
  4426.         <lockText> <true /> </lockText>
  4427.         <rect>
  4428.             <left>190</left>
  4429.             <top>112</top>
  4430.             <right>233</right>
  4431.             <bottom>126</bottom>
  4432.         </rect>
  4433.         <style>transparent</style>
  4434.         <autoSelect> <false /> </autoSelect>
  4435.         <showLines> <false /> </showLines>
  4436.         <wideMargins> <false /> </wideMargins>
  4437.         <multipleLines> <false /> </multipleLines>
  4438.         <reservedFamily> 0 </reservedFamily>
  4439.         <titleWidth>0</titleWidth>
  4440.         <icon>0</icon>
  4441.         <textAlign>right</textAlign>
  4442.         <font>Palatino</font>
  4443.         <textSize>10</textSize>
  4444.         <textStyle>plain</textStyle>
  4445.         <textHeight>13</textHeight>
  4446.         <name></name>
  4447.         <script></script>
  4448.     </part>
  4449.     <part>
  4450.         <id>36</id>
  4451.         <type>field</type>
  4452.         <visible> <true /> </visible>
  4453.         <dontWrap> <false /> </dontWrap>
  4454.         <dontSearch> <false /> </dontSearch>
  4455.         <sharedText> <false /> </sharedText>
  4456.         <fixedLineHeight> <true /> </fixedLineHeight>
  4457.         <autoTab> <false /> </autoTab>
  4458.         <lockText> <true /> </lockText>
  4459.         <rect>
  4460.             <left>14</left>
  4461.             <top>112</top>
  4462.             <right>233</right>
  4463.             <bottom>126</bottom>
  4464.         </rect>
  4465.         <style>transparent</style>
  4466.         <autoSelect> <false /> </autoSelect>
  4467.         <showLines> <false /> </showLines>
  4468.         <wideMargins> <false /> </wideMargins>
  4469.         <multipleLines> <false /> </multipleLines>
  4470.         <reservedFamily> 0 </reservedFamily>
  4471.         <titleWidth>0</titleWidth>
  4472.         <icon>0</icon>
  4473.         <textAlign>left</textAlign>
  4474.         <font>Palatino</font>
  4475.         <textSize>10</textSize>
  4476.         <textStyle>plain</textStyle>
  4477.         <textHeight>13</textHeight>
  4478.         <name></name>
  4479.         <script>on mouseUp
  4480. visual iris open
  4481. get the number of the target
  4482. get card field (it-1)
  4483. if it is not "" then
  4484. go card it
  4485. end if
  4486. end mouseUp
  4487. </script>
  4488.     </part>
  4489.     <part>
  4490.         <id>39</id>
  4491.         <type>field</type>
  4492.         <visible> <true /> </visible>
  4493.         <dontWrap> <false /> </dontWrap>
  4494.         <dontSearch> <false /> </dontSearch>
  4495.         <sharedText> <false /> </sharedText>
  4496.         <fixedLineHeight> <true /> </fixedLineHeight>
  4497.         <autoTab> <false /> </autoTab>
  4498.         <lockText> <true /> </lockText>
  4499.         <rect>
  4500.             <left>190</left>
  4501.             <top>125</top>
  4502.             <right>233</right>
  4503.             <bottom>139</bottom>
  4504.         </rect>
  4505.         <style>transparent</style>
  4506.         <autoSelect> <false /> </autoSelect>
  4507.         <showLines> <false /> </showLines>
  4508.         <wideMargins> <false /> </wideMargins>
  4509.         <multipleLines> <false /> </multipleLines>
  4510.         <reservedFamily> 0 </reservedFamily>
  4511.         <titleWidth>0</titleWidth>
  4512.         <icon>0</icon>
  4513.         <textAlign>right</textAlign>
  4514.         <font>Palatino</font>
  4515.         <textSize>10</textSize>
  4516.         <textStyle>plain</textStyle>
  4517.         <textHeight>13</textHeight>
  4518.         <name></name>
  4519.         <script></script>
  4520.     </part>
  4521.     <part>
  4522.         <id>38</id>
  4523.         <type>field</type>
  4524.         <visible> <true /> </visible>
  4525.         <dontWrap> <false /> </dontWrap>
  4526.         <dontSearch> <false /> </dontSearch>
  4527.         <sharedText> <false /> </sharedText>
  4528.         <fixedLineHeight> <true /> </fixedLineHeight>
  4529.         <autoTab> <false /> </autoTab>
  4530.         <lockText> <true /> </lockText>
  4531.         <rect>
  4532.             <left>14</left>
  4533.             <top>125</top>
  4534.             <right>233</right>
  4535.             <bottom>139</bottom>
  4536.         </rect>
  4537.         <style>transparent</style>
  4538.         <autoSelect> <false /> </autoSelect>
  4539.         <showLines> <false /> </showLines>
  4540.         <wideMargins> <false /> </wideMargins>
  4541.         <multipleLines> <false /> </multipleLines>
  4542.         <reservedFamily> 0 </reservedFamily>
  4543.         <titleWidth>0</titleWidth>
  4544.         <icon>0</icon>
  4545.         <textAlign>left</textAlign>
  4546.         <font>Palatino</font>
  4547.         <textSize>10</textSize>
  4548.         <textStyle>plain</textStyle>
  4549.         <textHeight>13</textHeight>
  4550.         <name></name>
  4551.         <script>on mouseUp
  4552. visual iris open
  4553. get the number of the target
  4554. get card field (it-1)
  4555. if it is not "" then
  4556. go card it
  4557. end if
  4558. end mouseUp
  4559. </script>
  4560.     </part>
  4561.     <part>
  4562.         <id>44</id>
  4563.         <type>field</type>
  4564.         <visible> <true /> </visible>
  4565.         <dontWrap> <false /> </dontWrap>
  4566.         <dontSearch> <false /> </dontSearch>
  4567.         <sharedText> <false /> </sharedText>
  4568.         <fixedLineHeight> <true /> </fixedLineHeight>
  4569.         <autoTab> <false /> </autoTab>
  4570.         <lockText> <true /> </lockText>
  4571.         <rect>
  4572.             <left>190</left>
  4573.             <top>138</top>
  4574.             <right>233</right>
  4575.             <bottom>151</bottom>
  4576.         </rect>
  4577.         <style>transparent</style>
  4578.         <autoSelect> <false /> </autoSelect>
  4579.         <showLines> <false /> </showLines>
  4580.         <wideMargins> <false /> </wideMargins>
  4581.         <multipleLines> <false /> </multipleLines>
  4582.         <reservedFamily> 0 </reservedFamily>
  4583.         <titleWidth>0</titleWidth>
  4584.         <icon>0</icon>
  4585.         <textAlign>right</textAlign>
  4586.         <font>Palatino</font>
  4587.         <textSize>10</textSize>
  4588.         <textStyle>plain</textStyle>
  4589.         <textHeight>13</textHeight>
  4590.         <name></name>
  4591.         <script></script>
  4592.     </part>
  4593.     <part>
  4594.         <id>43</id>
  4595.         <type>field</type>
  4596.         <visible> <true /> </visible>
  4597.         <dontWrap> <false /> </dontWrap>
  4598.         <dontSearch> <false /> </dontSearch>
  4599.         <sharedText> <false /> </sharedText>
  4600.         <fixedLineHeight> <true /> </fixedLineHeight>
  4601.         <autoTab> <false /> </autoTab>
  4602.         <lockText> <true /> </lockText>
  4603.         <rect>
  4604.             <left>14</left>
  4605.             <top>138</top>
  4606.             <right>233</right>
  4607.             <bottom>152</bottom>
  4608.         </rect>
  4609.         <style>transparent</style>
  4610.         <autoSelect> <false /> </autoSelect>
  4611.         <showLines> <false /> </showLines>
  4612.         <wideMargins> <false /> </wideMargins>
  4613.         <multipleLines> <false /> </multipleLines>
  4614.         <reservedFamily> 0 </reservedFamily>
  4615.         <titleWidth>0</titleWidth>
  4616.         <icon>0</icon>
  4617.         <textAlign>left</textAlign>
  4618.         <font>Palatino</font>
  4619.         <textSize>10</textSize>
  4620.         <textStyle>plain</textStyle>
  4621.         <textHeight>13</textHeight>
  4622.         <name></name>
  4623.         <script>on mouseUp
  4624. visual iris open
  4625. get the number of the target
  4626. get card field (it-1)
  4627. if it is not "" then
  4628. go card it
  4629. end if
  4630. end mouseUp
  4631. </script>
  4632.     </part>
  4633.     <part>
  4634.         <id>46</id>
  4635.         <type>field</type>
  4636.         <visible> <true /> </visible>
  4637.         <dontWrap> <false /> </dontWrap>
  4638.         <dontSearch> <false /> </dontSearch>
  4639.         <sharedText> <false /> </sharedText>
  4640.         <fixedLineHeight> <true /> </fixedLineHeight>
  4641.         <autoTab> <false /> </autoTab>
  4642.         <lockText> <true /> </lockText>
  4643.         <rect>
  4644.             <left>190</left>
  4645.             <top>151</top>
  4646.             <right>233</right>
  4647.             <bottom>165</bottom>
  4648.         </rect>
  4649.         <style>transparent</style>
  4650.         <autoSelect> <false /> </autoSelect>
  4651.         <showLines> <false /> </showLines>
  4652.         <wideMargins> <false /> </wideMargins>
  4653.         <multipleLines> <false /> </multipleLines>
  4654.         <reservedFamily> 0 </reservedFamily>
  4655.         <titleWidth>0</titleWidth>
  4656.         <icon>0</icon>
  4657.         <textAlign>right</textAlign>
  4658.         <font>Palatino</font>
  4659.         <textSize>10</textSize>
  4660.         <textStyle>plain</textStyle>
  4661.         <textHeight>13</textHeight>
  4662.         <name></name>
  4663.         <script></script>
  4664.     </part>
  4665.     <part>
  4666.         <id>45</id>
  4667.         <type>field</type>
  4668.         <visible> <true /> </visible>
  4669.         <dontWrap> <false /> </dontWrap>
  4670.         <dontSearch> <false /> </dontSearch>
  4671.         <sharedText> <false /> </sharedText>
  4672.         <fixedLineHeight> <true /> </fixedLineHeight>
  4673.         <autoTab> <false /> </autoTab>
  4674.         <lockText> <true /> </lockText>
  4675.         <rect>
  4676.             <left>14</left>
  4677.             <top>151</top>
  4678.             <right>233</right>
  4679.             <bottom>165</bottom>
  4680.         </rect>
  4681.         <style>transparent</style>
  4682.         <autoSelect> <false /> </autoSelect>
  4683.         <showLines> <false /> </showLines>
  4684.         <wideMargins> <false /> </wideMargins>
  4685.         <multipleLines> <false /> </multipleLines>
  4686.         <reservedFamily> 0 </reservedFamily>
  4687.         <titleWidth>0</titleWidth>
  4688.         <icon>0</icon>
  4689.         <textAlign>left</textAlign>
  4690.         <font>Palatino</font>
  4691.         <textSize>10</textSize>
  4692.         <textStyle>plain</textStyle>
  4693.         <textHeight>13</textHeight>
  4694.         <name></name>
  4695.         <script>on mouseUp
  4696. visual iris open
  4697. get the number of the target
  4698. get card field (it-1)
  4699. if it is not "" then
  4700. go card it
  4701. end if
  4702. end mouseUp
  4703. </script>
  4704.     </part>
  4705.     <part>
  4706.         <id>48</id>
  4707.         <type>field</type>
  4708.         <visible> <true /> </visible>
  4709.         <dontWrap> <false /> </dontWrap>
  4710.         <dontSearch> <false /> </dontSearch>
  4711.         <sharedText> <false /> </sharedText>
  4712.         <fixedLineHeight> <true /> </fixedLineHeight>
  4713.         <autoTab> <false /> </autoTab>
  4714.         <lockText> <true /> </lockText>
  4715.         <rect>
  4716.             <left>190</left>
  4717.             <top>164</top>
  4718.             <right>233</right>
  4719.             <bottom>178</bottom>
  4720.         </rect>
  4721.         <style>transparent</style>
  4722.         <autoSelect> <false /> </autoSelect>
  4723.         <showLines> <false /> </showLines>
  4724.         <wideMargins> <false /> </wideMargins>
  4725.         <multipleLines> <false /> </multipleLines>
  4726.         <reservedFamily> 0 </reservedFamily>
  4727.         <titleWidth>0</titleWidth>
  4728.         <icon>0</icon>
  4729.         <textAlign>right</textAlign>
  4730.         <font>Palatino</font>
  4731.         <textSize>10</textSize>
  4732.         <textStyle>plain</textStyle>
  4733.         <textHeight>13</textHeight>
  4734.         <name></name>
  4735.         <script></script>
  4736.     </part>
  4737.     <part>
  4738.         <id>47</id>
  4739.         <type>field</type>
  4740.         <visible> <true /> </visible>
  4741.         <dontWrap> <false /> </dontWrap>
  4742.         <dontSearch> <false /> </dontSearch>
  4743.         <sharedText> <false /> </sharedText>
  4744.         <fixedLineHeight> <true /> </fixedLineHeight>
  4745.         <autoTab> <false /> </autoTab>
  4746.         <lockText> <true /> </lockText>
  4747.         <rect>
  4748.             <left>14</left>
  4749.             <top>164</top>
  4750.             <right>233</right>
  4751.             <bottom>178</bottom>
  4752.         </rect>
  4753.         <style>transparent</style>
  4754.         <autoSelect> <false /> </autoSelect>
  4755.         <showLines> <false /> </showLines>
  4756.         <wideMargins> <false /> </wideMargins>
  4757.         <multipleLines> <false /> </multipleLines>
  4758.         <reservedFamily> 0 </reservedFamily>
  4759.         <titleWidth>0</titleWidth>
  4760.         <icon>0</icon>
  4761.         <textAlign>left</textAlign>
  4762.         <font>Palatino</font>
  4763.         <textSize>10</textSize>
  4764.         <textStyle>plain</textStyle>
  4765.         <textHeight>13</textHeight>
  4766.         <name></name>
  4767.         <script>on mouseUp
  4768. visual iris open
  4769. get the number of the target
  4770. get card field (it-1)
  4771. if it is not "" then
  4772. go card it
  4773. end if
  4774. end mouseUp
  4775. </script>
  4776.     </part>
  4777.     <part>
  4778.         <id>50</id>
  4779.         <type>field</type>
  4780.         <visible> <true /> </visible>
  4781.         <dontWrap> <false /> </dontWrap>
  4782.         <dontSearch> <false /> </dontSearch>
  4783.         <sharedText> <false /> </sharedText>
  4784.         <fixedLineHeight> <true /> </fixedLineHeight>
  4785.         <autoTab> <false /> </autoTab>
  4786.         <lockText> <true /> </lockText>
  4787.         <rect>
  4788.             <left>190</left>
  4789.             <top>177</top>
  4790.             <right>233</right>
  4791.             <bottom>191</bottom>
  4792.         </rect>
  4793.         <style>transparent</style>
  4794.         <autoSelect> <false /> </autoSelect>
  4795.         <showLines> <false /> </showLines>
  4796.         <wideMargins> <false /> </wideMargins>
  4797.         <multipleLines> <false /> </multipleLines>
  4798.         <reservedFamily> 0 </reservedFamily>
  4799.         <titleWidth>0</titleWidth>
  4800.         <icon>0</icon>
  4801.         <textAlign>right</textAlign>
  4802.         <font>Palatino</font>
  4803.         <textSize>10</textSize>
  4804.         <textStyle>plain</textStyle>
  4805.         <textHeight>13</textHeight>
  4806.         <name></name>
  4807.         <script></script>
  4808.     </part>
  4809.     <part>
  4810.         <id>49</id>
  4811.         <type>field</type>
  4812.         <visible> <true /> </visible>
  4813.         <dontWrap> <false /> </dontWrap>
  4814.         <dontSearch> <false /> </dontSearch>
  4815.         <sharedText> <false /> </sharedText>
  4816.         <fixedLineHeight> <true /> </fixedLineHeight>
  4817.         <autoTab> <false /> </autoTab>
  4818.         <lockText> <true /> </lockText>
  4819.         <rect>
  4820.             <left>14</left>
  4821.             <top>177</top>
  4822.             <right>233</right>
  4823.             <bottom>191</bottom>
  4824.         </rect>
  4825.         <style>transparent</style>
  4826.         <autoSelect> <false /> </autoSelect>
  4827.         <showLines> <false /> </showLines>
  4828.         <wideMargins> <false /> </wideMargins>
  4829.         <multipleLines> <false /> </multipleLines>
  4830.         <reservedFamily> 0 </reservedFamily>
  4831.         <titleWidth>0</titleWidth>
  4832.         <icon>0</icon>
  4833.         <textAlign>left</textAlign>
  4834.         <font>Palatino</font>
  4835.         <textSize>10</textSize>
  4836.         <textStyle>plain</textStyle>
  4837.         <textHeight>13</textHeight>
  4838.         <name></name>
  4839.         <script>on mouseUp
  4840. visual iris open
  4841. get the number of the target
  4842. get card field (it-1)
  4843. if it is not "" then
  4844. go card it
  4845. end if
  4846. end mouseUp
  4847. </script>
  4848.     </part>
  4849.     <part>
  4850.         <id>52</id>
  4851.         <type>field</type>
  4852.         <visible> <true /> </visible>
  4853.         <dontWrap> <false /> </dontWrap>
  4854.         <dontSearch> <false /> </dontSearch>
  4855.         <sharedText> <false /> </sharedText>
  4856.         <fixedLineHeight> <true /> </fixedLineHeight>
  4857.         <autoTab> <false /> </autoTab>
  4858.         <lockText> <true /> </lockText>
  4859.         <rect>
  4860.             <left>190</left>
  4861.             <top>190</top>
  4862.             <right>233</right>
  4863.             <bottom>203</bottom>
  4864.         </rect>
  4865.         <style>transparent</style>
  4866.         <autoSelect> <false /> </autoSelect>
  4867.         <showLines> <false /> </showLines>
  4868.         <wideMargins> <false /> </wideMargins>
  4869.         <multipleLines> <false /> </multipleLines>
  4870.         <reservedFamily> 0 </reservedFamily>
  4871.         <titleWidth>0</titleWidth>
  4872.         <icon>0</icon>
  4873.         <textAlign>right</textAlign>
  4874.         <font>Palatino</font>
  4875.         <textSize>10</textSize>
  4876.         <textStyle>plain</textStyle>
  4877.         <textHeight>13</textHeight>
  4878.         <name></name>
  4879.         <script></script>
  4880.     </part>
  4881.     <part>
  4882.         <id>51</id>
  4883.         <type>field</type>
  4884.         <visible> <true /> </visible>
  4885.         <dontWrap> <false /> </dontWrap>
  4886.         <dontSearch> <false /> </dontSearch>
  4887.         <sharedText> <false /> </sharedText>
  4888.         <fixedLineHeight> <true /> </fixedLineHeight>
  4889.         <autoTab> <false /> </autoTab>
  4890.         <lockText> <true /> </lockText>
  4891.         <rect>
  4892.             <left>14</left>
  4893.             <top>190</top>
  4894.             <right>233</right>
  4895.             <bottom>204</bottom>
  4896.         </rect>
  4897.         <style>transparent</style>
  4898.         <autoSelect> <false /> </autoSelect>
  4899.         <showLines> <false /> </showLines>
  4900.         <wideMargins> <false /> </wideMargins>
  4901.         <multipleLines> <false /> </multipleLines>
  4902.         <reservedFamily> 0 </reservedFamily>
  4903.         <titleWidth>0</titleWidth>
  4904.         <icon>0</icon>
  4905.         <textAlign>left</textAlign>
  4906.         <font>Palatino</font>
  4907.         <textSize>10</textSize>
  4908.         <textStyle>plain</textStyle>
  4909.         <textHeight>13</textHeight>
  4910.         <name></name>
  4911.         <script>on mouseUp
  4912. visual iris open
  4913. get the number of the target
  4914. get card field (it-1)
  4915. if it is not "" then
  4916. go card it
  4917. end if
  4918. end mouseUp
  4919. </script>
  4920.     </part>
  4921.     <part>
  4922.         <id>54</id>
  4923.         <type>field</type>
  4924.         <visible> <true /> </visible>
  4925.         <dontWrap> <false /> </dontWrap>
  4926.         <dontSearch> <false /> </dontSearch>
  4927.         <sharedText> <false /> </sharedText>
  4928.         <fixedLineHeight> <true /> </fixedLineHeight>
  4929.         <autoTab> <false /> </autoTab>
  4930.         <lockText> <true /> </lockText>
  4931.         <rect>
  4932.             <left>190</left>
  4933.             <top>203</top>
  4934.             <right>233</right>
  4935.             <bottom>217</bottom>
  4936.         </rect>
  4937.         <style>transparent</style>
  4938.         <autoSelect> <false /> </autoSelect>
  4939.         <showLines> <false /> </showLines>
  4940.         <wideMargins> <false /> </wideMargins>
  4941.         <multipleLines> <false /> </multipleLines>
  4942.         <reservedFamily> 0 </reservedFamily>
  4943.         <titleWidth>0</titleWidth>
  4944.         <icon>0</icon>
  4945.         <textAlign>right</textAlign>
  4946.         <font>Palatino</font>
  4947.         <textSize>10</textSize>
  4948.         <textStyle>plain</textStyle>
  4949.         <textHeight>13</textHeight>
  4950.         <name></name>
  4951.         <script></script>
  4952.     </part>
  4953.     <part>
  4954.         <id>53</id>
  4955.         <type>field</type>
  4956.         <visible> <true /> </visible>
  4957.         <dontWrap> <false /> </dontWrap>
  4958.         <dontSearch> <false /> </dontSearch>
  4959.         <sharedText> <false /> </sharedText>
  4960.         <fixedLineHeight> <true /> </fixedLineHeight>
  4961.         <autoTab> <false /> </autoTab>
  4962.         <lockText> <true /> </lockText>
  4963.         <rect>
  4964.             <left>14</left>
  4965.             <top>203</top>
  4966.             <right>233</right>
  4967.             <bottom>217</bottom>
  4968.         </rect>
  4969.         <style>transparent</style>
  4970.         <autoSelect> <false /> </autoSelect>
  4971.         <showLines> <false /> </showLines>
  4972.         <wideMargins> <false /> </wideMargins>
  4973.         <multipleLines> <false /> </multipleLines>
  4974.         <reservedFamily> 0 </reservedFamily>
  4975.         <titleWidth>0</titleWidth>
  4976.         <icon>0</icon>
  4977.         <textAlign>left</textAlign>
  4978.         <font>Palatino</font>
  4979.         <textSize>10</textSize>
  4980.         <textStyle>plain</textStyle>
  4981.         <textHeight>13</textHeight>
  4982.         <name></name>
  4983.         <script>on mouseUp
  4984. visual iris open
  4985. get the number of the target
  4986. get card field (it-1)
  4987. if it is not "" then
  4988. go card it
  4989. end if
  4990. end mouseUp
  4991. </script>
  4992.     </part>
  4993.     <part>
  4994.         <id>56</id>
  4995.         <type>field</type>
  4996.         <visible> <true /> </visible>
  4997.         <dontWrap> <false /> </dontWrap>
  4998.         <dontSearch> <false /> </dontSearch>
  4999.         <sharedText> <false /> </sharedText>
  5000.         <fixedLineHeight> <true /> </fixedLineHeight>
  5001.         <autoTab> <false /> </autoTab>
  5002.         <lockText> <true /> </lockText>
  5003.         <rect>
  5004.             <left>190</left>
  5005.             <top>216</top>
  5006.             <right>233</right>
  5007.             <bottom>230</bottom>
  5008.         </rect>
  5009.         <style>transparent</style>
  5010.         <autoSelect> <false /> </autoSelect>
  5011.         <showLines> <false /> </showLines>
  5012.         <wideMargins> <false /> </wideMargins>
  5013.         <multipleLines> <false /> </multipleLines>
  5014.         <reservedFamily> 0 </reservedFamily>
  5015.         <titleWidth>0</titleWidth>
  5016.         <icon>0</icon>
  5017.         <textAlign>right</textAlign>
  5018.         <font>Palatino</font>
  5019.         <textSize>10</textSize>
  5020.         <textStyle>plain</textStyle>
  5021.         <textHeight>13</textHeight>
  5022.         <name></name>
  5023.         <script></script>
  5024.     </part>
  5025.     <part>
  5026.         <id>55</id>
  5027.         <type>field</type>
  5028.         <visible> <true /> </visible>
  5029.         <dontWrap> <false /> </dontWrap>
  5030.         <dontSearch> <false /> </dontSearch>
  5031.         <sharedText> <false /> </sharedText>
  5032.         <fixedLineHeight> <true /> </fixedLineHeight>
  5033.         <autoTab> <false /> </autoTab>
  5034.         <lockText> <true /> </lockText>
  5035.         <rect>
  5036.             <left>14</left>
  5037.             <top>216</top>
  5038.             <right>233</right>
  5039.             <bottom>230</bottom>
  5040.         </rect>
  5041.         <style>transparent</style>
  5042.         <autoSelect> <false /> </autoSelect>
  5043.         <showLines> <false /> </showLines>
  5044.         <wideMargins> <false /> </wideMargins>
  5045.         <multipleLines> <false /> </multipleLines>
  5046.         <reservedFamily> 0 </reservedFamily>
  5047.         <titleWidth>0</titleWidth>
  5048.         <icon>0</icon>
  5049.         <textAlign>left</textAlign>
  5050.         <font>Palatino</font>
  5051.         <textSize>10</textSize>
  5052.         <textStyle>plain</textStyle>
  5053.         <textHeight>13</textHeight>
  5054.         <name></name>
  5055.         <script>on mouseUp
  5056. visual iris open
  5057. get the number of the target
  5058. get card field (it-1)
  5059. if it is not "" then
  5060. go card it
  5061. end if
  5062. end mouseUp
  5063. </script>
  5064.     </part>
  5065.     <part>
  5066.         <id>58</id>
  5067.         <type>field</type>
  5068.         <visible> <true /> </visible>
  5069.         <dontWrap> <false /> </dontWrap>
  5070.         <dontSearch> <false /> </dontSearch>
  5071.         <sharedText> <false /> </sharedText>
  5072.         <fixedLineHeight> <true /> </fixedLineHeight>
  5073.         <autoTab> <false /> </autoTab>
  5074.         <lockText> <true /> </lockText>
  5075.         <rect>
  5076.             <left>190</left>
  5077.             <top>229</top>
  5078.             <right>233</right>
  5079.             <bottom>243</bottom>
  5080.         </rect>
  5081.         <style>transparent</style>
  5082.         <autoSelect> <false /> </autoSelect>
  5083.         <showLines> <false /> </showLines>
  5084.         <wideMargins> <false /> </wideMargins>
  5085.         <multipleLines> <false /> </multipleLines>
  5086.         <reservedFamily> 0 </reservedFamily>
  5087.         <titleWidth>0</titleWidth>
  5088.         <icon>0</icon>
  5089.         <textAlign>right</textAlign>
  5090.         <font>Palatino</font>
  5091.         <textSize>10</textSize>
  5092.         <textStyle>plain</textStyle>
  5093.         <textHeight>13</textHeight>
  5094.         <name></name>
  5095.         <script></script>
  5096.     </part>
  5097.     <part>
  5098.         <id>57</id>
  5099.         <type>field</type>
  5100.         <visible> <true /> </visible>
  5101.         <dontWrap> <false /> </dontWrap>
  5102.         <dontSearch> <false /> </dontSearch>
  5103.         <sharedText> <false /> </sharedText>
  5104.         <fixedLineHeight> <true /> </fixedLineHeight>
  5105.         <autoTab> <false /> </autoTab>
  5106.         <lockText> <true /> </lockText>
  5107.         <rect>
  5108.             <left>14</left>
  5109.             <top>229</top>
  5110.             <right>233</right>
  5111.             <bottom>243</bottom>
  5112.         </rect>
  5113.         <style>transparent</style>
  5114.         <autoSelect> <false /> </autoSelect>
  5115.         <showLines> <false /> </showLines>
  5116.         <wideMargins> <false /> </wideMargins>
  5117.         <multipleLines> <false /> </multipleLines>
  5118.         <reservedFamily> 0 </reservedFamily>
  5119.         <titleWidth>0</titleWidth>
  5120.         <icon>0</icon>
  5121.         <textAlign>left</textAlign>
  5122.         <font>Palatino</font>
  5123.         <textSize>10</textSize>
  5124.         <textStyle>plain</textStyle>
  5125.         <textHeight>13</textHeight>
  5126.         <name></name>
  5127.         <script>on mouseUp
  5128. visual iris open
  5129. get the number of the target
  5130. get card field (it-1)
  5131. if it is not "" then
  5132. go card it
  5133. end if
  5134. end mouseUp
  5135. </script>
  5136.     </part>
  5137.     <part>
  5138.         <id>60</id>
  5139.         <type>field</type>
  5140.         <visible> <true /> </visible>
  5141.         <dontWrap> <false /> </dontWrap>
  5142.         <dontSearch> <false /> </dontSearch>
  5143.         <sharedText> <false /> </sharedText>
  5144.         <fixedLineHeight> <true /> </fixedLineHeight>
  5145.         <autoTab> <false /> </autoTab>
  5146.         <lockText> <true /> </lockText>
  5147.         <rect>
  5148.             <left>190</left>
  5149.             <top>242</top>
  5150.             <right>233</right>
  5151.             <bottom>255</bottom>
  5152.         </rect>
  5153.         <style>transparent</style>
  5154.         <autoSelect> <false /> </autoSelect>
  5155.         <showLines> <false /> </showLines>
  5156.         <wideMargins> <false /> </wideMargins>
  5157.         <multipleLines> <false /> </multipleLines>
  5158.         <reservedFamily> 0 </reservedFamily>
  5159.         <titleWidth>0</titleWidth>
  5160.         <icon>0</icon>
  5161.         <textAlign>right</textAlign>
  5162.         <font>Palatino</font>
  5163.         <textSize>10</textSize>
  5164.         <textStyle>plain</textStyle>
  5165.         <textHeight>13</textHeight>
  5166.         <name></name>
  5167.         <script></script>
  5168.     </part>
  5169.     <part>
  5170.         <id>59</id>
  5171.         <type>field</type>
  5172.         <visible> <true /> </visible>
  5173.         <dontWrap> <false /> </dontWrap>
  5174.         <dontSearch> <false /> </dontSearch>
  5175.         <sharedText> <false /> </sharedText>
  5176.         <fixedLineHeight> <true /> </fixedLineHeight>
  5177.         <autoTab> <false /> </autoTab>
  5178.         <lockText> <true /> </lockText>
  5179.         <rect>
  5180.             <left>14</left>
  5181.             <top>242</top>
  5182.             <right>233</right>
  5183.             <bottom>256</bottom>
  5184.         </rect>
  5185.         <style>transparent</style>
  5186.         <autoSelect> <false /> </autoSelect>
  5187.         <showLines> <false /> </showLines>
  5188.         <wideMargins> <false /> </wideMargins>
  5189.         <multipleLines> <false /> </multipleLines>
  5190.         <reservedFamily> 0 </reservedFamily>
  5191.         <titleWidth>0</titleWidth>
  5192.         <icon>0</icon>
  5193.         <textAlign>left</textAlign>
  5194.         <font>Palatino</font>
  5195.         <textSize>10</textSize>
  5196.         <textStyle>plain</textStyle>
  5197.         <textHeight>13</textHeight>
  5198.         <name></name>
  5199.         <script>on mouseUp
  5200. visual iris open
  5201. get the number of the target
  5202. get card field (it-1)
  5203. if it is not "" then
  5204. go card it
  5205. end if
  5206. end mouseUp
  5207. </script>
  5208.     </part>
  5209.     <part>
  5210.         <id>62</id>
  5211.         <type>field</type>
  5212.         <visible> <true /> </visible>
  5213.         <dontWrap> <false /> </dontWrap>
  5214.         <dontSearch> <false /> </dontSearch>
  5215.         <sharedText> <false /> </sharedText>
  5216.         <fixedLineHeight> <true /> </fixedLineHeight>
  5217.         <autoTab> <false /> </autoTab>
  5218.         <lockText> <true /> </lockText>
  5219.         <rect>
  5220.             <left>190</left>
  5221.             <top>255</top>
  5222.             <right>233</right>
  5223.             <bottom>268</bottom>
  5224.         </rect>
  5225.         <style>transparent</style>
  5226.         <autoSelect> <false /> </autoSelect>
  5227.         <showLines> <false /> </showLines>
  5228.         <wideMargins> <false /> </wideMargins>
  5229.         <multipleLines> <false /> </multipleLines>
  5230.         <reservedFamily> 0 </reservedFamily>
  5231.         <titleWidth>0</titleWidth>
  5232.         <icon>0</icon>
  5233.         <textAlign>right</textAlign>
  5234.         <font>Palatino</font>
  5235.         <textSize>10</textSize>
  5236.         <textStyle>plain</textStyle>
  5237.         <textHeight>13</textHeight>
  5238.         <name></name>
  5239.         <script></script>
  5240.     </part>
  5241.     <part>
  5242.         <id>61</id>
  5243.         <type>field</type>
  5244.         <visible> <true /> </visible>
  5245.         <dontWrap> <false /> </dontWrap>
  5246.         <dontSearch> <false /> </dontSearch>
  5247.         <sharedText> <false /> </sharedText>
  5248.         <fixedLineHeight> <true /> </fixedLineHeight>
  5249.         <autoTab> <false /> </autoTab>
  5250.         <lockText> <true /> </lockText>
  5251.         <rect>
  5252.             <left>14</left>
  5253.             <top>255</top>
  5254.             <right>233</right>
  5255.             <bottom>269</bottom>
  5256.         </rect>
  5257.         <style>transparent</style>
  5258.         <autoSelect> <false /> </autoSelect>
  5259.         <showLines> <false /> </showLines>
  5260.         <wideMargins> <false /> </wideMargins>
  5261.         <multipleLines> <false /> </multipleLines>
  5262.         <reservedFamily> 0 </reservedFamily>
  5263.         <titleWidth>0</titleWidth>
  5264.         <icon>0</icon>
  5265.         <textAlign>left</textAlign>
  5266.         <font>Palatino</font>
  5267.         <textSize>10</textSize>
  5268.         <textStyle>plain</textStyle>
  5269.         <textHeight>13</textHeight>
  5270.         <name></name>
  5271.         <script>on mouseUp
  5272. visual iris open
  5273. get the number of the target
  5274. get card field (it-1)
  5275. if it is not "" then
  5276. go card it
  5277. end if
  5278. end mouseUp
  5279. </script>
  5280.     </part>
  5281.     <part>
  5282.         <id>64</id>
  5283.         <type>field</type>
  5284.         <visible> <true /> </visible>
  5285.         <dontWrap> <false /> </dontWrap>
  5286.         <dontSearch> <false /> </dontSearch>
  5287.         <sharedText> <false /> </sharedText>
  5288.         <fixedLineHeight> <true /> </fixedLineHeight>
  5289.         <autoTab> <false /> </autoTab>
  5290.         <lockText> <true /> </lockText>
  5291.         <rect>
  5292.             <left>190</left>
  5293.             <top>268</top>
  5294.             <right>233</right>
  5295.             <bottom>282</bottom>
  5296.         </rect>
  5297.         <style>transparent</style>
  5298.         <autoSelect> <false /> </autoSelect>
  5299.         <showLines> <false /> </showLines>
  5300.         <wideMargins> <false /> </wideMargins>
  5301.         <multipleLines> <false /> </multipleLines>
  5302.         <reservedFamily> 0 </reservedFamily>
  5303.         <titleWidth>0</titleWidth>
  5304.         <icon>0</icon>
  5305.         <textAlign>right</textAlign>
  5306.         <font>Palatino</font>
  5307.         <textSize>10</textSize>
  5308.         <textStyle>plain</textStyle>
  5309.         <textHeight>13</textHeight>
  5310.         <name></name>
  5311.         <script></script>
  5312.     </part>
  5313.     <part>
  5314.         <id>63</id>
  5315.         <type>field</type>
  5316.         <visible> <true /> </visible>
  5317.         <dontWrap> <false /> </dontWrap>
  5318.         <dontSearch> <false /> </dontSearch>
  5319.         <sharedText> <false /> </sharedText>
  5320.         <fixedLineHeight> <true /> </fixedLineHeight>
  5321.         <autoTab> <false /> </autoTab>
  5322.         <lockText> <true /> </lockText>
  5323.         <rect>
  5324.             <left>14</left>
  5325.             <top>268</top>
  5326.             <right>233</right>
  5327.             <bottom>282</bottom>
  5328.         </rect>
  5329.         <style>transparent</style>
  5330.         <autoSelect> <false /> </autoSelect>
  5331.         <showLines> <false /> </showLines>
  5332.         <wideMargins> <false /> </wideMargins>
  5333.         <multipleLines> <false /> </multipleLines>
  5334.         <reservedFamily> 0 </reservedFamily>
  5335.         <titleWidth>0</titleWidth>
  5336.         <icon>0</icon>
  5337.         <textAlign>left</textAlign>
  5338.         <font>Palatino</font>
  5339.         <textSize>10</textSize>
  5340.         <textStyle>plain</textStyle>
  5341.         <textHeight>13</textHeight>
  5342.         <name></name>
  5343.         <script>on mouseUp
  5344. visual iris open
  5345. get the number of the target
  5346. get card field (it-1)
  5347. if it is not "" then
  5348. go card it
  5349. end if
  5350. end mouseUp
  5351. </script>
  5352.     </part>
  5353.     <part>
  5354.         <id>66</id>
  5355.         <type>field</type>
  5356.         <visible> <true /> </visible>
  5357.         <dontWrap> <false /> </dontWrap>
  5358.         <dontSearch> <false /> </dontSearch>
  5359.         <sharedText> <false /> </sharedText>
  5360.         <fixedLineHeight> <true /> </fixedLineHeight>
  5361.         <autoTab> <false /> </autoTab>
  5362.         <lockText> <true /> </lockText>
  5363.         <rect>
  5364.             <left>190</left>
  5365.             <top>281</top>
  5366.             <right>233</right>
  5367.             <bottom>295</bottom>
  5368.         </rect>
  5369.         <style>transparent</style>
  5370.         <autoSelect> <false /> </autoSelect>
  5371.         <showLines> <false /> </showLines>
  5372.         <wideMargins> <false /> </wideMargins>
  5373.         <multipleLines> <false /> </multipleLines>
  5374.         <reservedFamily> 0 </reservedFamily>
  5375.         <titleWidth>0</titleWidth>
  5376.         <icon>0</icon>
  5377.         <textAlign>right</textAlign>
  5378.         <font>Palatino</font>
  5379.         <textSize>10</textSize>
  5380.         <textStyle>plain</textStyle>
  5381.         <textHeight>13</textHeight>
  5382.         <name></name>
  5383.         <script></script>
  5384.     </part>
  5385.     <part>
  5386.         <id>65</id>
  5387.         <type>field</type>
  5388.         <visible> <true /> </visible>
  5389.         <dontWrap> <false /> </dontWrap>
  5390.         <dontSearch> <false /> </dontSearch>
  5391.         <sharedText> <false /> </sharedText>
  5392.         <fixedLineHeight> <true /> </fixedLineHeight>
  5393.         <autoTab> <false /> </autoTab>
  5394.         <lockText> <true /> </lockText>
  5395.         <rect>
  5396.             <left>14</left>
  5397.             <top>281</top>
  5398.             <right>233</right>
  5399.             <bottom>295</bottom>
  5400.         </rect>
  5401.         <style>transparent</style>
  5402.         <autoSelect> <false /> </autoSelect>
  5403.         <showLines> <false /> </showLines>
  5404.         <wideMargins> <false /> </wideMargins>
  5405.         <multipleLines> <false /> </multipleLines>
  5406.         <reservedFamily> 0 </reservedFamily>
  5407.         <titleWidth>0</titleWidth>
  5408.         <icon>0</icon>
  5409.         <textAlign>left</textAlign>
  5410.         <font>Palatino</font>
  5411.         <textSize>10</textSize>
  5412.         <textStyle>plain</textStyle>
  5413.         <textHeight>13</textHeight>
  5414.         <name></name>
  5415.         <script>on mouseUp
  5416. visual iris open
  5417. get the number of the target
  5418. get card field (it-1)
  5419. if it is not "" then
  5420. go card it
  5421. end if
  5422. end mouseUp
  5423. </script>
  5424.     </part>
  5425.     <part>
  5426.         <id>84</id>
  5427.         <type>field</type>
  5428.         <visible> <true /> </visible>
  5429.         <dontWrap> <false /> </dontWrap>
  5430.         <dontSearch> <false /> </dontSearch>
  5431.         <sharedText> <false /> </sharedText>
  5432.         <fixedLineHeight> <true /> </fixedLineHeight>
  5433.         <autoTab> <false /> </autoTab>
  5434.         <lockText> <true /> </lockText>
  5435.         <rect>
  5436.             <left>451</left>
  5437.             <top>60</top>
  5438.             <right>494</right>
  5439.             <bottom>74</bottom>
  5440.         </rect>
  5441.         <style>transparent</style>
  5442.         <autoSelect> <false /> </autoSelect>
  5443.         <showLines> <false /> </showLines>
  5444.         <wideMargins> <false /> </wideMargins>
  5445.         <multipleLines> <false /> </multipleLines>
  5446.         <reservedFamily> 0 </reservedFamily>
  5447.         <titleWidth>0</titleWidth>
  5448.         <icon>0</icon>
  5449.         <textAlign>right</textAlign>
  5450.         <font>Palatino</font>
  5451.         <textSize>10</textSize>
  5452.         <textStyle>plain</textStyle>
  5453.         <textHeight>13</textHeight>
  5454.         <name></name>
  5455.         <script></script>
  5456.     </part>
  5457.     <part>
  5458.         <id>85</id>
  5459.         <type>field</type>
  5460.         <visible> <true /> </visible>
  5461.         <dontWrap> <false /> </dontWrap>
  5462.         <dontSearch> <false /> </dontSearch>
  5463.         <sharedText> <false /> </sharedText>
  5464.         <fixedLineHeight> <true /> </fixedLineHeight>
  5465.         <autoTab> <false /> </autoTab>
  5466.         <lockText> <true /> </lockText>
  5467.         <rect>
  5468.             <left>275</left>
  5469.             <top>60</top>
  5470.             <right>494</right>
  5471.             <bottom>74</bottom>
  5472.         </rect>
  5473.         <style>transparent</style>
  5474.         <autoSelect> <false /> </autoSelect>
  5475.         <showLines> <false /> </showLines>
  5476.         <wideMargins> <false /> </wideMargins>
  5477.         <multipleLines> <false /> </multipleLines>
  5478.         <reservedFamily> 0 </reservedFamily>
  5479.         <titleWidth>0</titleWidth>
  5480.         <icon>0</icon>
  5481.         <textAlign>left</textAlign>
  5482.         <font>Palatino</font>
  5483.         <textSize>10</textSize>
  5484.         <textStyle>plain</textStyle>
  5485.         <textHeight>13</textHeight>
  5486.         <name></name>
  5487.         <script>on mouseUp
  5488. visual iris open
  5489. get the number of the target
  5490. get card field (it-1)
  5491. if it is not "" then
  5492. go card it
  5493. end if
  5494. end mouseUp
  5495. </script>
  5496.     </part>
  5497.     <part>
  5498.         <id>90</id>
  5499.         <type>field</type>
  5500.         <visible> <true /> </visible>
  5501.         <dontWrap> <false /> </dontWrap>
  5502.         <dontSearch> <false /> </dontSearch>
  5503.         <sharedText> <false /> </sharedText>
  5504.         <fixedLineHeight> <true /> </fixedLineHeight>
  5505.         <autoTab> <false /> </autoTab>
  5506.         <lockText> <true /> </lockText>
  5507.         <rect>
  5508.             <left>451</left>
  5509.             <top>73</top>
  5510.             <right>494</right>
  5511.             <bottom>87</bottom>
  5512.         </rect>
  5513.         <style>transparent</style>
  5514.         <autoSelect> <false /> </autoSelect>
  5515.         <showLines> <false /> </showLines>
  5516.         <wideMargins> <false /> </wideMargins>
  5517.         <multipleLines> <false /> </multipleLines>
  5518.         <reservedFamily> 0 </reservedFamily>
  5519.         <titleWidth>0</titleWidth>
  5520.         <icon>0</icon>
  5521.         <textAlign>right</textAlign>
  5522.         <font>Palatino</font>
  5523.         <textSize>10</textSize>
  5524.         <textStyle>plain</textStyle>
  5525.         <textHeight>13</textHeight>
  5526.         <name></name>
  5527.         <script></script>
  5528.     </part>
  5529.     <part>
  5530.         <id>89</id>
  5531.         <type>field</type>
  5532.         <visible> <true /> </visible>
  5533.         <dontWrap> <false /> </dontWrap>
  5534.         <dontSearch> <false /> </dontSearch>
  5535.         <sharedText> <false /> </sharedText>
  5536.         <fixedLineHeight> <true /> </fixedLineHeight>
  5537.         <autoTab> <false /> </autoTab>
  5538.         <lockText> <true /> </lockText>
  5539.         <rect>
  5540.             <left>275</left>
  5541.             <top>73</top>
  5542.             <right>494</right>
  5543.             <bottom>87</bottom>
  5544.         </rect>
  5545.         <style>transparent</style>
  5546.         <autoSelect> <false /> </autoSelect>
  5547.         <showLines> <false /> </showLines>
  5548.         <wideMargins> <false /> </wideMargins>
  5549.         <multipleLines> <false /> </multipleLines>
  5550.         <reservedFamily> 0 </reservedFamily>
  5551.         <titleWidth>0</titleWidth>
  5552.         <icon>0</icon>
  5553.         <textAlign>left</textAlign>
  5554.         <font>Palatino</font>
  5555.         <textSize>10</textSize>
  5556.         <textStyle>plain</textStyle>
  5557.         <textHeight>13</textHeight>
  5558.         <name></name>
  5559.         <script>on mouseUp
  5560. visual iris open
  5561. get the number of the target
  5562. get card field (it-1)
  5563. if it is not "" then
  5564. go card it
  5565. end if
  5566. end mouseUp
  5567. </script>
  5568.     </part>
  5569.     <part>
  5570.         <id>92</id>
  5571.         <type>field</type>
  5572.         <visible> <true /> </visible>
  5573.         <dontWrap> <false /> </dontWrap>
  5574.         <dontSearch> <false /> </dontSearch>
  5575.         <sharedText> <false /> </sharedText>
  5576.         <fixedLineHeight> <true /> </fixedLineHeight>
  5577.         <autoTab> <false /> </autoTab>
  5578.         <lockText> <true /> </lockText>
  5579.         <rect>
  5580.             <left>451</left>
  5581.             <top>86</top>
  5582.             <right>494</right>
  5583.             <bottom>100</bottom>
  5584.         </rect>
  5585.         <style>transparent</style>
  5586.         <autoSelect> <false /> </autoSelect>
  5587.         <showLines> <false /> </showLines>
  5588.         <wideMargins> <false /> </wideMargins>
  5589.         <multipleLines> <false /> </multipleLines>
  5590.         <reservedFamily> 0 </reservedFamily>
  5591.         <titleWidth>0</titleWidth>
  5592.         <icon>0</icon>
  5593.         <textAlign>right</textAlign>
  5594.         <font>Palatino</font>
  5595.         <textSize>10</textSize>
  5596.         <textStyle>plain</textStyle>
  5597.         <textHeight>13</textHeight>
  5598.         <name></name>
  5599.         <script></script>
  5600.     </part>
  5601.     <part>
  5602.         <id>91</id>
  5603.         <type>field</type>
  5604.         <visible> <true /> </visible>
  5605.         <dontWrap> <false /> </dontWrap>
  5606.         <dontSearch> <false /> </dontSearch>
  5607.         <sharedText> <false /> </sharedText>
  5608.         <fixedLineHeight> <true /> </fixedLineHeight>
  5609.         <autoTab> <false /> </autoTab>
  5610.         <lockText> <true /> </lockText>
  5611.         <rect>
  5612.             <left>275</left>
  5613.             <top>86</top>
  5614.             <right>494</right>
  5615.             <bottom>100</bottom>
  5616.         </rect>
  5617.         <style>transparent</style>
  5618.         <autoSelect> <false /> </autoSelect>
  5619.         <showLines> <false /> </showLines>
  5620.         <wideMargins> <false /> </wideMargins>
  5621.         <multipleLines> <false /> </multipleLines>
  5622.         <reservedFamily> 0 </reservedFamily>
  5623.         <titleWidth>0</titleWidth>
  5624.         <icon>0</icon>
  5625.         <textAlign>left</textAlign>
  5626.         <font>Palatino</font>
  5627.         <textSize>10</textSize>
  5628.         <textStyle>plain</textStyle>
  5629.         <textHeight>13</textHeight>
  5630.         <name></name>
  5631.         <script>on mouseUp
  5632. visual iris open
  5633. get the number of the target
  5634. get card field (it-1)
  5635. if it is not "" then
  5636. go card it
  5637. end if
  5638. end mouseUp
  5639. </script>
  5640.     </part>
  5641.     <part>
  5642.         <id>94</id>
  5643.         <type>field</type>
  5644.         <visible> <true /> </visible>
  5645.         <dontWrap> <false /> </dontWrap>
  5646.         <dontSearch> <false /> </dontSearch>
  5647.         <sharedText> <false /> </sharedText>
  5648.         <fixedLineHeight> <true /> </fixedLineHeight>
  5649.         <autoTab> <false /> </autoTab>
  5650.         <lockText> <true /> </lockText>
  5651.         <rect>
  5652.             <left>451</left>
  5653.             <top>99</top>
  5654.             <right>494</right>
  5655.             <bottom>113</bottom>
  5656.         </rect>
  5657.         <style>transparent</style>
  5658.         <autoSelect> <false /> </autoSelect>
  5659.         <showLines> <false /> </showLines>
  5660.         <wideMargins> <false /> </wideMargins>
  5661.         <multipleLines> <false /> </multipleLines>
  5662.         <reservedFamily> 0 </reservedFamily>
  5663.         <titleWidth>0</titleWidth>
  5664.         <icon>0</icon>
  5665.         <textAlign>right</textAlign>
  5666.         <font>Palatino</font>
  5667.         <textSize>10</textSize>
  5668.         <textStyle>plain</textStyle>
  5669.         <textHeight>13</textHeight>
  5670.         <name></name>
  5671.         <script></script>
  5672.     </part>
  5673.     <part>
  5674.         <id>93</id>
  5675.         <type>field</type>
  5676.         <visible> <true /> </visible>
  5677.         <dontWrap> <false /> </dontWrap>
  5678.         <dontSearch> <false /> </dontSearch>
  5679.         <sharedText> <false /> </sharedText>
  5680.         <fixedLineHeight> <true /> </fixedLineHeight>
  5681.         <autoTab> <false /> </autoTab>
  5682.         <lockText> <true /> </lockText>
  5683.         <rect>
  5684.             <left>275</left>
  5685.             <top>99</top>
  5686.             <right>494</right>
  5687.             <bottom>113</bottom>
  5688.         </rect>
  5689.         <style>transparent</style>
  5690.         <autoSelect> <false /> </autoSelect>
  5691.         <showLines> <false /> </showLines>
  5692.         <wideMargins> <false /> </wideMargins>
  5693.         <multipleLines> <false /> </multipleLines>
  5694.         <reservedFamily> 0 </reservedFamily>
  5695.         <titleWidth>0</titleWidth>
  5696.         <icon>0</icon>
  5697.         <textAlign>left</textAlign>
  5698.         <font>Palatino</font>
  5699.         <textSize>10</textSize>
  5700.         <textStyle>plain</textStyle>
  5701.         <textHeight>13</textHeight>
  5702.         <name></name>
  5703.         <script>on mouseUp
  5704. visual iris open
  5705. get the number of the target
  5706. get card field (it-1)
  5707. if it is not "" then
  5708. go card it
  5709. end if
  5710. end mouseUp
  5711. </script>
  5712.     </part>
  5713.     <part>
  5714.         <id>96</id>
  5715.         <type>field</type>
  5716.         <visible> <true /> </visible>
  5717.         <dontWrap> <false /> </dontWrap>
  5718.         <dontSearch> <false /> </dontSearch>
  5719.         <sharedText> <false /> </sharedText>
  5720.         <fixedLineHeight> <true /> </fixedLineHeight>
  5721.         <autoTab> <false /> </autoTab>
  5722.         <lockText> <true /> </lockText>
  5723.         <rect>
  5724.             <left>451</left>
  5725.             <top>112</top>
  5726.             <right>494</right>
  5727.             <bottom>126</bottom>
  5728.         </rect>
  5729.         <style>transparent</style>
  5730.         <autoSelect> <false /> </autoSelect>
  5731.         <showLines> <false /> </showLines>
  5732.         <wideMargins> <false /> </wideMargins>
  5733.         <multipleLines> <false /> </multipleLines>
  5734.         <reservedFamily> 0 </reservedFamily>
  5735.         <titleWidth>0</titleWidth>
  5736.         <icon>0</icon>
  5737.         <textAlign>right</textAlign>
  5738.         <font>Palatino</font>
  5739.         <textSize>10</textSize>
  5740.         <textStyle>plain</textStyle>
  5741.         <textHeight>13</textHeight>
  5742.         <name></name>
  5743.         <script></script>
  5744.     </part>
  5745.     <part>
  5746.         <id>95</id>
  5747.         <type>field</type>
  5748.         <visible> <true /> </visible>
  5749.         <dontWrap> <false /> </dontWrap>
  5750.         <dontSearch> <false /> </dontSearch>
  5751.         <sharedText> <false /> </sharedText>
  5752.         <fixedLineHeight> <true /> </fixedLineHeight>
  5753.         <autoTab> <false /> </autoTab>
  5754.         <lockText> <true /> </lockText>
  5755.         <rect>
  5756.             <left>275</left>
  5757.             <top>112</top>
  5758.             <right>494</right>
  5759.             <bottom>126</bottom>
  5760.         </rect>
  5761.         <style>transparent</style>
  5762.         <autoSelect> <false /> </autoSelect>
  5763.         <showLines> <false /> </showLines>
  5764.         <wideMargins> <false /> </wideMargins>
  5765.         <multipleLines> <false /> </multipleLines>
  5766.         <reservedFamily> 0 </reservedFamily>
  5767.         <titleWidth>0</titleWidth>
  5768.         <icon>0</icon>
  5769.         <textAlign>left</textAlign>
  5770.         <font>Palatino</font>
  5771.         <textSize>10</textSize>
  5772.         <textStyle>plain</textStyle>
  5773.         <textHeight>13</textHeight>
  5774.         <name></name>
  5775.         <script>on mouseUp
  5776. visual iris open
  5777. get the number of the target
  5778. get card field (it-1)
  5779. if it is not "" then
  5780. go card it
  5781. end if
  5782. end mouseUp
  5783. </script>
  5784.     </part>
  5785.     <part>
  5786.         <id>98</id>
  5787.         <type>field</type>
  5788.         <visible> <true /> </visible>
  5789.         <dontWrap> <false /> </dontWrap>
  5790.         <dontSearch> <false /> </dontSearch>
  5791.         <sharedText> <false /> </sharedText>
  5792.         <fixedLineHeight> <true /> </fixedLineHeight>
  5793.         <autoTab> <false /> </autoTab>
  5794.         <lockText> <true /> </lockText>
  5795.         <rect>
  5796.             <left>451</left>
  5797.             <top>125</top>
  5798.             <right>494</right>
  5799.             <bottom>139</bottom>
  5800.         </rect>
  5801.         <style>transparent</style>
  5802.         <autoSelect> <false /> </autoSelect>
  5803.         <showLines> <false /> </showLines>
  5804.         <wideMargins> <false /> </wideMargins>
  5805.         <multipleLines> <false /> </multipleLines>
  5806.         <reservedFamily> 0 </reservedFamily>
  5807.         <titleWidth>0</titleWidth>
  5808.         <icon>0</icon>
  5809.         <textAlign>right</textAlign>
  5810.         <font>Palatino</font>
  5811.         <textSize>10</textSize>
  5812.         <textStyle>plain</textStyle>
  5813.         <textHeight>13</textHeight>
  5814.         <name></name>
  5815.         <script></script>
  5816.     </part>
  5817.     <part>
  5818.         <id>97</id>
  5819.         <type>field</type>
  5820.         <visible> <true /> </visible>
  5821.         <dontWrap> <false /> </dontWrap>
  5822.         <dontSearch> <false /> </dontSearch>
  5823.         <sharedText> <false /> </sharedText>
  5824.         <fixedLineHeight> <true /> </fixedLineHeight>
  5825.         <autoTab> <false /> </autoTab>
  5826.         <lockText> <true /> </lockText>
  5827.         <rect>
  5828.             <left>275</left>
  5829.             <top>125</top>
  5830.             <right>494</right>
  5831.             <bottom>139</bottom>
  5832.         </rect>
  5833.         <style>transparent</style>
  5834.         <autoSelect> <false /> </autoSelect>
  5835.         <showLines> <false /> </showLines>
  5836.         <wideMargins> <false /> </wideMargins>
  5837.         <multipleLines> <false /> </multipleLines>
  5838.         <reservedFamily> 0 </reservedFamily>
  5839.         <titleWidth>0</titleWidth>
  5840.         <icon>0</icon>
  5841.         <textAlign>left</textAlign>
  5842.         <font>Palatino</font>
  5843.         <textSize>10</textSize>
  5844.         <textStyle>plain</textStyle>
  5845.         <textHeight>13</textHeight>
  5846.         <name></name>
  5847.         <script>on mouseUp
  5848. visual iris open
  5849. get the number of the target
  5850. get card field (it-1)
  5851. if it is not "" then
  5852. go card it
  5853. end if
  5854. end mouseUp
  5855. </script>
  5856.     </part>
  5857.     <part>
  5858.         <id>100</id>
  5859.         <type>field</type>
  5860.         <visible> <true /> </visible>
  5861.         <dontWrap> <false /> </dontWrap>
  5862.         <dontSearch> <false /> </dontSearch>
  5863.         <sharedText> <false /> </sharedText>
  5864.         <fixedLineHeight> <true /> </fixedLineHeight>
  5865.         <autoTab> <false /> </autoTab>
  5866.         <lockText> <true /> </lockText>
  5867.         <rect>
  5868.             <left>451</left>
  5869.             <top>138</top>
  5870.             <right>494</right>
  5871.             <bottom>152</bottom>
  5872.         </rect>
  5873.         <style>transparent</style>
  5874.         <autoSelect> <false /> </autoSelect>
  5875.         <showLines> <false /> </showLines>
  5876.         <wideMargins> <false /> </wideMargins>
  5877.         <multipleLines> <false /> </multipleLines>
  5878.         <reservedFamily> 0 </reservedFamily>
  5879.         <titleWidth>0</titleWidth>
  5880.         <icon>0</icon>
  5881.         <textAlign>right</textAlign>
  5882.         <font>Palatino</font>
  5883.         <textSize>10</textSize>
  5884.         <textStyle>plain</textStyle>
  5885.         <textHeight>13</textHeight>
  5886.         <name></name>
  5887.         <script></script>
  5888.     </part>
  5889.     <part>
  5890.         <id>99</id>
  5891.         <type>field</type>
  5892.         <visible> <true /> </visible>
  5893.         <dontWrap> <false /> </dontWrap>
  5894.         <dontSearch> <false /> </dontSearch>
  5895.         <sharedText> <false /> </sharedText>
  5896.         <fixedLineHeight> <true /> </fixedLineHeight>
  5897.         <autoTab> <false /> </autoTab>
  5898.         <lockText> <true /> </lockText>
  5899.         <rect>
  5900.             <left>275</left>
  5901.             <top>138</top>
  5902.             <right>494</right>
  5903.             <bottom>152</bottom>
  5904.         </rect>
  5905.         <style>transparent</style>
  5906.         <autoSelect> <false /> </autoSelect>
  5907.         <showLines> <false /> </showLines>
  5908.         <wideMargins> <false /> </wideMargins>
  5909.         <multipleLines> <false /> </multipleLines>
  5910.         <reservedFamily> 0 </reservedFamily>
  5911.         <titleWidth>0</titleWidth>
  5912.         <icon>0</icon>
  5913.         <textAlign>left</textAlign>
  5914.         <font>Palatino</font>
  5915.         <textSize>10</textSize>
  5916.         <textStyle>plain</textStyle>
  5917.         <textHeight>13</textHeight>
  5918.         <name></name>
  5919.         <script>on mouseUp
  5920. visual iris open
  5921. get the number of the target
  5922. get card field (it-1)
  5923. if it is not "" then
  5924. go card it
  5925. end if
  5926. end mouseUp
  5927. </script>
  5928.     </part>
  5929.     <part>
  5930.         <id>102</id>
  5931.         <type>field</type>
  5932.         <visible> <true /> </visible>
  5933.         <dontWrap> <false /> </dontWrap>
  5934.         <dontSearch> <false /> </dontSearch>
  5935.         <sharedText> <false /> </sharedText>
  5936.         <fixedLineHeight> <true /> </fixedLineHeight>
  5937.         <autoTab> <false /> </autoTab>
  5938.         <lockText> <true /> </lockText>
  5939.         <rect>
  5940.             <left>451</left>
  5941.             <top>151</top>
  5942.             <right>494</right>
  5943.             <bottom>165</bottom>
  5944.         </rect>
  5945.         <style>transparent</style>
  5946.         <autoSelect> <false /> </autoSelect>
  5947.         <showLines> <false /> </showLines>
  5948.         <wideMargins> <false /> </wideMargins>
  5949.         <multipleLines> <false /> </multipleLines>
  5950.         <reservedFamily> 0 </reservedFamily>
  5951.         <titleWidth>0</titleWidth>
  5952.         <icon>0</icon>
  5953.         <textAlign>right</textAlign>
  5954.         <font>Palatino</font>
  5955.         <textSize>10</textSize>
  5956.         <textStyle>plain</textStyle>
  5957.         <textHeight>13</textHeight>
  5958.         <name></name>
  5959.         <script></script>
  5960.     </part>
  5961.     <part>
  5962.         <id>101</id>
  5963.         <type>field</type>
  5964.         <visible> <true /> </visible>
  5965.         <dontWrap> <false /> </dontWrap>
  5966.         <dontSearch> <false /> </dontSearch>
  5967.         <sharedText> <false /> </sharedText>
  5968.         <fixedLineHeight> <true /> </fixedLineHeight>
  5969.         <autoTab> <false /> </autoTab>
  5970.         <lockText> <true /> </lockText>
  5971.         <rect>
  5972.             <left>275</left>
  5973.             <top>151</top>
  5974.             <right>494</right>
  5975.             <bottom>165</bottom>
  5976.         </rect>
  5977.         <style>transparent</style>
  5978.         <autoSelect> <false /> </autoSelect>
  5979.         <showLines> <false /> </showLines>
  5980.         <wideMargins> <false /> </wideMargins>
  5981.         <multipleLines> <false /> </multipleLines>
  5982.         <reservedFamily> 0 </reservedFamily>
  5983.         <titleWidth>0</titleWidth>
  5984.         <icon>0</icon>
  5985.         <textAlign>left</textAlign>
  5986.         <font>Palatino</font>
  5987.         <textSize>10</textSize>
  5988.         <textStyle>plain</textStyle>
  5989.         <textHeight>13</textHeight>
  5990.         <name></name>
  5991.         <script>on mouseUp
  5992. visual iris open
  5993. get the number of the target
  5994. get card field (it-1)
  5995. if it is not "" then
  5996. go card it
  5997. end if
  5998. end mouseUp
  5999. </script>
  6000.     </part>
  6001.     <part>
  6002.         <id>104</id>
  6003.         <type>field</type>
  6004.         <visible> <true /> </visible>
  6005.         <dontWrap> <false /> </dontWrap>
  6006.         <dontSearch> <false /> </dontSearch>
  6007.         <sharedText> <false /> </sharedText>
  6008.         <fixedLineHeight> <true /> </fixedLineHeight>
  6009.         <autoTab> <false /> </autoTab>
  6010.         <lockText> <true /> </lockText>
  6011.         <rect>
  6012.             <left>451</left>
  6013.             <top>164</top>
  6014.             <right>494</right>
  6015.             <bottom>178</bottom>
  6016.         </rect>
  6017.         <style>transparent</style>
  6018.         <autoSelect> <false /> </autoSelect>
  6019.         <showLines> <false /> </showLines>
  6020.         <wideMargins> <false /> </wideMargins>
  6021.         <multipleLines> <false /> </multipleLines>
  6022.         <reservedFamily> 0 </reservedFamily>
  6023.         <titleWidth>0</titleWidth>
  6024.         <icon>0</icon>
  6025.         <textAlign>right</textAlign>
  6026.         <font>Palatino</font>
  6027.         <textSize>10</textSize>
  6028.         <textStyle>plain</textStyle>
  6029.         <textHeight>13</textHeight>
  6030.         <name></name>
  6031.         <script></script>
  6032.     </part>
  6033.     <part>
  6034.         <id>103</id>
  6035.         <type>field</type>
  6036.         <visible> <true /> </visible>
  6037.         <dontWrap> <false /> </dontWrap>
  6038.         <dontSearch> <false /> </dontSearch>
  6039.         <sharedText> <false /> </sharedText>
  6040.         <fixedLineHeight> <true /> </fixedLineHeight>
  6041.         <autoTab> <false /> </autoTab>
  6042.         <lockText> <true /> </lockText>
  6043.         <rect>
  6044.             <left>275</left>
  6045.             <top>164</top>
  6046.             <right>494</right>
  6047.             <bottom>178</bottom>
  6048.         </rect>
  6049.         <style>transparent</style>
  6050.         <autoSelect> <false /> </autoSelect>
  6051.         <showLines> <false /> </showLines>
  6052.         <wideMargins> <false /> </wideMargins>
  6053.         <multipleLines> <false /> </multipleLines>
  6054.         <reservedFamily> 0 </reservedFamily>
  6055.         <titleWidth>0</titleWidth>
  6056.         <icon>0</icon>
  6057.         <textAlign>left</textAlign>
  6058.         <font>Palatino</font>
  6059.         <textSize>10</textSize>
  6060.         <textStyle>plain</textStyle>
  6061.         <textHeight>13</textHeight>
  6062.         <name></name>
  6063.         <script>on mouseUp
  6064. visual iris open
  6065. get the number of the target
  6066. get card field (it-1)
  6067. if it is not "" then
  6068. go card it
  6069. end if
  6070. end mouseUp
  6071. </script>
  6072.     </part>
  6073.     <part>
  6074.         <id>106</id>
  6075.         <type>field</type>
  6076.         <visible> <true /> </visible>
  6077.         <dontWrap> <false /> </dontWrap>
  6078.         <dontSearch> <false /> </dontSearch>
  6079.         <sharedText> <false /> </sharedText>
  6080.         <fixedLineHeight> <true /> </fixedLineHeight>
  6081.         <autoTab> <false /> </autoTab>
  6082.         <lockText> <true /> </lockText>
  6083.         <rect>
  6084.             <left>451</left>
  6085.             <top>177</top>
  6086.             <right>494</right>
  6087.             <bottom>191</bottom>
  6088.         </rect>
  6089.         <style>transparent</style>
  6090.         <autoSelect> <false /> </autoSelect>
  6091.         <showLines> <false /> </showLines>
  6092.         <wideMargins> <false /> </wideMargins>
  6093.         <multipleLines> <false /> </multipleLines>
  6094.         <reservedFamily> 0 </reservedFamily>
  6095.         <titleWidth>0</titleWidth>
  6096.         <icon>0</icon>
  6097.         <textAlign>right</textAlign>
  6098.         <font>Palatino</font>
  6099.         <textSize>10</textSize>
  6100.         <textStyle>plain</textStyle>
  6101.         <textHeight>13</textHeight>
  6102.         <name></name>
  6103.         <script></script>
  6104.     </part>
  6105.     <part>
  6106.         <id>105</id>
  6107.         <type>field</type>
  6108.         <visible> <true /> </visible>
  6109.         <dontWrap> <false /> </dontWrap>
  6110.         <dontSearch> <false /> </dontSearch>
  6111.         <sharedText> <false /> </sharedText>
  6112.         <fixedLineHeight> <true /> </fixedLineHeight>
  6113.         <autoTab> <false /> </autoTab>
  6114.         <lockText> <true /> </lockText>
  6115.         <rect>
  6116.             <left>275</left>
  6117.             <top>177</top>
  6118.             <right>494</right>
  6119.             <bottom>191</bottom>
  6120.         </rect>
  6121.         <style>transparent</style>
  6122.         <autoSelect> <false /> </autoSelect>
  6123.         <showLines> <false /> </showLines>
  6124.         <wideMargins> <false /> </wideMargins>
  6125.         <multipleLines> <false /> </multipleLines>
  6126.         <reservedFamily> 0 </reservedFamily>
  6127.         <titleWidth>0</titleWidth>
  6128.         <icon>0</icon>
  6129.         <textAlign>left</textAlign>
  6130.         <font>Palatino</font>
  6131.         <textSize>10</textSize>
  6132.         <textStyle>plain</textStyle>
  6133.         <textHeight>13</textHeight>
  6134.         <name></name>
  6135.         <script>on mouseUp
  6136. visual iris open
  6137. get the number of the target
  6138. get card field (it-1)
  6139. if it is not "" then
  6140. go card it
  6141. end if
  6142. end mouseUp
  6143. </script>
  6144.     </part>
  6145.     <part>
  6146.         <id>108</id>
  6147.         <type>field</type>
  6148.         <visible> <true /> </visible>
  6149.         <dontWrap> <false /> </dontWrap>
  6150.         <dontSearch> <false /> </dontSearch>
  6151.         <sharedText> <false /> </sharedText>
  6152.         <fixedLineHeight> <true /> </fixedLineHeight>
  6153.         <autoTab> <false /> </autoTab>
  6154.         <lockText> <true /> </lockText>
  6155.         <rect>
  6156.             <left>451</left>
  6157.             <top>190</top>
  6158.             <right>494</right>
  6159.             <bottom>204</bottom>
  6160.         </rect>
  6161.         <style>transparent</style>
  6162.         <autoSelect> <false /> </autoSelect>
  6163.         <showLines> <false /> </showLines>
  6164.         <wideMargins> <false /> </wideMargins>
  6165.         <multipleLines> <false /> </multipleLines>
  6166.         <reservedFamily> 0 </reservedFamily>
  6167.         <titleWidth>0</titleWidth>
  6168.         <icon>0</icon>
  6169.         <textAlign>right</textAlign>
  6170.         <font>Palatino</font>
  6171.         <textSize>10</textSize>
  6172.         <textStyle>plain</textStyle>
  6173.         <textHeight>13</textHeight>
  6174.         <name></name>
  6175.         <script></script>
  6176.     </part>
  6177.     <part>
  6178.         <id>107</id>
  6179.         <type>field</type>
  6180.         <visible> <true /> </visible>
  6181.         <dontWrap> <false /> </dontWrap>
  6182.         <dontSearch> <false /> </dontSearch>
  6183.         <sharedText> <false /> </sharedText>
  6184.         <fixedLineHeight> <true /> </fixedLineHeight>
  6185.         <autoTab> <false /> </autoTab>
  6186.         <lockText> <true /> </lockText>
  6187.         <rect>
  6188.             <left>275</left>
  6189.             <top>190</top>
  6190.             <right>494</right>
  6191.             <bottom>204</bottom>
  6192.         </rect>
  6193.         <style>transparent</style>
  6194.         <autoSelect> <false /> </autoSelect>
  6195.         <showLines> <false /> </showLines>
  6196.         <wideMargins> <false /> </wideMargins>
  6197.         <multipleLines> <false /> </multipleLines>
  6198.         <reservedFamily> 0 </reservedFamily>
  6199.         <titleWidth>0</titleWidth>
  6200.         <icon>0</icon>
  6201.         <textAlign>left</textAlign>
  6202.         <font>Palatino</font>
  6203.         <textSize>10</textSize>
  6204.         <textStyle>plain</textStyle>
  6205.         <textHeight>13</textHeight>
  6206.         <name></name>
  6207.         <script>on mouseUp
  6208. visual iris open
  6209. get the number of the target
  6210. get card field (it-1)
  6211. if it is not "" then
  6212. go card it
  6213. end if
  6214. end mouseUp
  6215. </script>
  6216.     </part>
  6217.     <part>
  6218.         <id>110</id>
  6219.         <type>field</type>
  6220.         <visible> <true /> </visible>
  6221.         <dontWrap> <false /> </dontWrap>
  6222.         <dontSearch> <false /> </dontSearch>
  6223.         <sharedText> <false /> </sharedText>
  6224.         <fixedLineHeight> <true /> </fixedLineHeight>
  6225.         <autoTab> <false /> </autoTab>
  6226.         <lockText> <true /> </lockText>
  6227.         <rect>
  6228.             <left>451</left>
  6229.             <top>203</top>
  6230.             <right>494</right>
  6231.             <bottom>217</bottom>
  6232.         </rect>
  6233.         <style>transparent</style>
  6234.         <autoSelect> <false /> </autoSelect>
  6235.         <showLines> <false /> </showLines>
  6236.         <wideMargins> <false /> </wideMargins>
  6237.         <multipleLines> <false /> </multipleLines>
  6238.         <reservedFamily> 0 </reservedFamily>
  6239.         <titleWidth>0</titleWidth>
  6240.         <icon>0</icon>
  6241.         <textAlign>right</textAlign>
  6242.         <font>Palatino</font>
  6243.         <textSize>10</textSize>
  6244.         <textStyle>plain</textStyle>
  6245.         <textHeight>13</textHeight>
  6246.         <name></name>
  6247.         <script></script>
  6248.     </part>
  6249.     <part>
  6250.         <id>109</id>
  6251.         <type>field</type>
  6252.         <visible> <true /> </visible>
  6253.         <dontWrap> <false /> </dontWrap>
  6254.         <dontSearch> <false /> </dontSearch>
  6255.         <sharedText> <false /> </sharedText>
  6256.         <fixedLineHeight> <true /> </fixedLineHeight>
  6257.         <autoTab> <false /> </autoTab>
  6258.         <lockText> <true /> </lockText>
  6259.         <rect>
  6260.             <left>275</left>
  6261.             <top>203</top>
  6262.             <right>494</right>
  6263.             <bottom>217</bottom>
  6264.         </rect>
  6265.         <style>transparent</style>
  6266.         <autoSelect> <false /> </autoSelect>
  6267.         <showLines> <false /> </showLines>
  6268.         <wideMargins> <false /> </wideMargins>
  6269.         <multipleLines> <false /> </multipleLines>
  6270.         <reservedFamily> 0 </reservedFamily>
  6271.         <titleWidth>0</titleWidth>
  6272.         <icon>0</icon>
  6273.         <textAlign>left</textAlign>
  6274.         <font>Palatino</font>
  6275.         <textSize>10</textSize>
  6276.         <textStyle>plain</textStyle>
  6277.         <textHeight>13</textHeight>
  6278.         <name></name>
  6279.         <script>on mouseUp
  6280. visual iris open
  6281. get the number of the target
  6282. get card field (it-1)
  6283. if it is not "" then
  6284. go card it
  6285. end if
  6286. end mouseUp
  6287. </script>
  6288.     </part>
  6289.     <part>
  6290.         <id>112</id>
  6291.         <type>field</type>
  6292.         <visible> <true /> </visible>
  6293.         <dontWrap> <false /> </dontWrap>
  6294.         <dontSearch> <false /> </dontSearch>
  6295.         <sharedText> <false /> </sharedText>
  6296.         <fixedLineHeight> <true /> </fixedLineHeight>
  6297.         <autoTab> <false /> </autoTab>
  6298.         <lockText> <true /> </lockText>
  6299.         <rect>
  6300.             <left>451</left>
  6301.             <top>216</top>
  6302.             <right>494</right>
  6303.             <bottom>230</bottom>
  6304.         </rect>
  6305.         <style>transparent</style>
  6306.         <autoSelect> <false /> </autoSelect>
  6307.         <showLines> <false /> </showLines>
  6308.         <wideMargins> <false /> </wideMargins>
  6309.         <multipleLines> <false /> </multipleLines>
  6310.         <reservedFamily> 0 </reservedFamily>
  6311.         <titleWidth>0</titleWidth>
  6312.         <icon>0</icon>
  6313.         <textAlign>right</textAlign>
  6314.         <font>Palatino</font>
  6315.         <textSize>10</textSize>
  6316.         <textStyle>plain</textStyle>
  6317.         <textHeight>13</textHeight>
  6318.         <name></name>
  6319.         <script></script>
  6320.     </part>
  6321.     <part>
  6322.         <id>111</id>
  6323.         <type>field</type>
  6324.         <visible> <true /> </visible>
  6325.         <dontWrap> <false /> </dontWrap>
  6326.         <dontSearch> <false /> </dontSearch>
  6327.         <sharedText> <false /> </sharedText>
  6328.         <fixedLineHeight> <true /> </fixedLineHeight>
  6329.         <autoTab> <false /> </autoTab>
  6330.         <lockText> <true /> </lockText>
  6331.         <rect>
  6332.             <left>275</left>
  6333.             <top>216</top>
  6334.             <right>494</right>
  6335.             <bottom>230</bottom>
  6336.         </rect>
  6337.         <style>transparent</style>
  6338.         <autoSelect> <false /> </autoSelect>
  6339.         <showLines> <false /> </showLines>
  6340.         <wideMargins> <false /> </wideMargins>
  6341.         <multipleLines> <false /> </multipleLines>
  6342.         <reservedFamily> 0 </reservedFamily>
  6343.         <titleWidth>0</titleWidth>
  6344.         <icon>0</icon>
  6345.         <textAlign>left</textAlign>
  6346.         <font>Palatino</font>
  6347.         <textSize>10</textSize>
  6348.         <textStyle>plain</textStyle>
  6349.         <textHeight>13</textHeight>
  6350.         <name></name>
  6351.         <script>on mouseUp
  6352. visual iris open
  6353. get the number of the target
  6354. get card field (it-1)
  6355. if it is not "" then
  6356. go card it
  6357. end if
  6358. end mouseUp
  6359. </script>
  6360.     </part>
  6361.     <part>
  6362.         <id>114</id>
  6363.         <type>field</type>
  6364.         <visible> <true /> </visible>
  6365.         <dontWrap> <false /> </dontWrap>
  6366.         <dontSearch> <false /> </dontSearch>
  6367.         <sharedText> <false /> </sharedText>
  6368.         <fixedLineHeight> <true /> </fixedLineHeight>
  6369.         <autoTab> <false /> </autoTab>
  6370.         <lockText> <true /> </lockText>
  6371.         <rect>
  6372.             <left>451</left>
  6373.             <top>229</top>
  6374.             <right>494</right>
  6375.             <bottom>243</bottom>
  6376.         </rect>
  6377.         <style>transparent</style>
  6378.         <autoSelect> <false /> </autoSelect>
  6379.         <showLines> <false /> </showLines>
  6380.         <wideMargins> <false /> </wideMargins>
  6381.         <multipleLines> <false /> </multipleLines>
  6382.         <reservedFamily> 0 </reservedFamily>
  6383.         <titleWidth>0</titleWidth>
  6384.         <icon>0</icon>
  6385.         <textAlign>right</textAlign>
  6386.         <font>Palatino</font>
  6387.         <textSize>10</textSize>
  6388.         <textStyle>plain</textStyle>
  6389.         <textHeight>13</textHeight>
  6390.         <name></name>
  6391.         <script></script>
  6392.     </part>
  6393.     <part>
  6394.         <id>113</id>
  6395.         <type>field</type>
  6396.         <visible> <true /> </visible>
  6397.         <dontWrap> <false /> </dontWrap>
  6398.         <dontSearch> <false /> </dontSearch>
  6399.         <sharedText> <false /> </sharedText>
  6400.         <fixedLineHeight> <true /> </fixedLineHeight>
  6401.         <autoTab> <false /> </autoTab>
  6402.         <lockText> <true /> </lockText>
  6403.         <rect>
  6404.             <left>275</left>
  6405.             <top>229</top>
  6406.             <right>494</right>
  6407.             <bottom>243</bottom>
  6408.         </rect>
  6409.         <style>transparent</style>
  6410.         <autoSelect> <false /> </autoSelect>
  6411.         <showLines> <false /> </showLines>
  6412.         <wideMargins> <false /> </wideMargins>
  6413.         <multipleLines> <false /> </multipleLines>
  6414.         <reservedFamily> 0 </reservedFamily>
  6415.         <titleWidth>0</titleWidth>
  6416.         <icon>0</icon>
  6417.         <textAlign>left</textAlign>
  6418.         <font>Palatino</font>
  6419.         <textSize>10</textSize>
  6420.         <textStyle>plain</textStyle>
  6421.         <textHeight>13</textHeight>
  6422.         <name></name>
  6423.         <script>on mouseUp
  6424. visual iris open
  6425. get the number of the target
  6426. get card field (it-1)
  6427. if it is not "" then
  6428. go card it
  6429. end if
  6430. end mouseUp
  6431. </script>
  6432.     </part>
  6433.     <part>
  6434.         <id>116</id>
  6435.         <type>field</type>
  6436.         <visible> <true /> </visible>
  6437.         <dontWrap> <false /> </dontWrap>
  6438.         <dontSearch> <false /> </dontSearch>
  6439.         <sharedText> <false /> </sharedText>
  6440.         <fixedLineHeight> <true /> </fixedLineHeight>
  6441.         <autoTab> <false /> </autoTab>
  6442.         <lockText> <true /> </lockText>
  6443.         <rect>
  6444.             <left>451</left>
  6445.             <top>242</top>
  6446.             <right>494</right>
  6447.             <bottom>256</bottom>
  6448.         </rect>
  6449.         <style>transparent</style>
  6450.         <autoSelect> <false /> </autoSelect>
  6451.         <showLines> <false /> </showLines>
  6452.         <wideMargins> <false /> </wideMargins>
  6453.         <multipleLines> <false /> </multipleLines>
  6454.         <reservedFamily> 0 </reservedFamily>
  6455.         <titleWidth>0</titleWidth>
  6456.         <icon>0</icon>
  6457.         <textAlign>right</textAlign>
  6458.         <font>Palatino</font>
  6459.         <textSize>10</textSize>
  6460.         <textStyle>plain</textStyle>
  6461.         <textHeight>13</textHeight>
  6462.         <name></name>
  6463.         <script></script>
  6464.     </part>
  6465.     <part>
  6466.         <id>115</id>
  6467.         <type>field</type>
  6468.         <visible> <true /> </visible>
  6469.         <dontWrap> <false /> </dontWrap>
  6470.         <dontSearch> <false /> </dontSearch>
  6471.         <sharedText> <false /> </sharedText>
  6472.         <fixedLineHeight> <true /> </fixedLineHeight>
  6473.         <autoTab> <false /> </autoTab>
  6474.         <lockText> <true /> </lockText>
  6475.         <rect>
  6476.             <left>275</left>
  6477.             <top>242</top>
  6478.             <right>494</right>
  6479.             <bottom>256</bottom>
  6480.         </rect>
  6481.         <style>transparent</style>
  6482.         <autoSelect> <false /> </autoSelect>
  6483.         <showLines> <false /> </showLines>
  6484.         <wideMargins> <false /> </wideMargins>
  6485.         <multipleLines> <false /> </multipleLines>
  6486.         <reservedFamily> 0 </reservedFamily>
  6487.         <titleWidth>0</titleWidth>
  6488.         <icon>0</icon>
  6489.         <textAlign>left</textAlign>
  6490.         <font>Palatino</font>
  6491.         <textSize>10</textSize>
  6492.         <textStyle>plain</textStyle>
  6493.         <textHeight>13</textHeight>
  6494.         <name></name>
  6495.         <script>on mouseUp
  6496. visual iris open
  6497. get the number of the target
  6498. get card field (it-1)
  6499. if it is not "" then
  6500. go card it
  6501. end if
  6502. end mouseUp
  6503. </script>
  6504.     </part>
  6505.     <part>
  6506.         <id>118</id>
  6507.         <type>field</type>
  6508.         <visible> <true /> </visible>
  6509.         <dontWrap> <false /> </dontWrap>
  6510.         <dontSearch> <false /> </dontSearch>
  6511.         <sharedText> <false /> </sharedText>
  6512.         <fixedLineHeight> <true /> </fixedLineHeight>
  6513.         <autoTab> <false /> </autoTab>
  6514.         <lockText> <true /> </lockText>
  6515.         <rect>
  6516.             <left>451</left>
  6517.             <top>255</top>
  6518.             <right>494</right>
  6519.             <bottom>269</bottom>
  6520.         </rect>
  6521.         <style>transparent</style>
  6522.         <autoSelect> <false /> </autoSelect>
  6523.         <showLines> <false /> </showLines>
  6524.         <wideMargins> <false /> </wideMargins>
  6525.         <multipleLines> <false /> </multipleLines>
  6526.         <reservedFamily> 0 </reservedFamily>
  6527.         <titleWidth>0</titleWidth>
  6528.         <icon>0</icon>
  6529.         <textAlign>right</textAlign>
  6530.         <font>Palatino</font>
  6531.         <textSize>10</textSize>
  6532.         <textStyle>plain</textStyle>
  6533.         <textHeight>13</textHeight>
  6534.         <name></name>
  6535.         <script></script>
  6536.     </part>
  6537.     <part>
  6538.         <id>117</id>
  6539.         <type>field</type>
  6540.         <visible> <true /> </visible>
  6541.         <dontWrap> <false /> </dontWrap>
  6542.         <dontSearch> <false /> </dontSearch>
  6543.         <sharedText> <false /> </sharedText>
  6544.         <fixedLineHeight> <true /> </fixedLineHeight>
  6545.         <autoTab> <false /> </autoTab>
  6546.         <lockText> <true /> </lockText>
  6547.         <rect>
  6548.             <left>275</left>
  6549.             <top>255</top>
  6550.             <right>494</right>
  6551.             <bottom>269</bottom>
  6552.         </rect>
  6553.         <style>transparent</style>
  6554.         <autoSelect> <false /> </autoSelect>
  6555.         <showLines> <false /> </showLines>
  6556.         <wideMargins> <false /> </wideMargins>
  6557.         <multipleLines> <false /> </multipleLines>
  6558.         <reservedFamily> 0 </reservedFamily>
  6559.         <titleWidth>0</titleWidth>
  6560.         <icon>0</icon>
  6561.         <textAlign>left</textAlign>
  6562.         <font>Palatino</font>
  6563.         <textSize>10</textSize>
  6564.         <textStyle>plain</textStyle>
  6565.         <textHeight>13</textHeight>
  6566.         <name></name>
  6567.         <script>on mouseUp
  6568. visual iris open
  6569. get the number of the target
  6570. get card field (it-1)
  6571. if it is not "" then
  6572. go card it
  6573. end if
  6574. end mouseUp
  6575. </script>
  6576.     </part>
  6577.     <part>
  6578.         <id>120</id>
  6579.         <type>field</type>
  6580.         <visible> <true /> </visible>
  6581.         <dontWrap> <false /> </dontWrap>
  6582.         <dontSearch> <false /> </dontSearch>
  6583.         <sharedText> <false /> </sharedText>
  6584.         <fixedLineHeight> <true /> </fixedLineHeight>
  6585.         <autoTab> <false /> </autoTab>
  6586.         <lockText> <true /> </lockText>
  6587.         <rect>
  6588.             <left>451</left>
  6589.             <top>268</top>
  6590.             <right>494</right>
  6591.             <bottom>282</bottom>
  6592.         </rect>
  6593.         <style>transparent</style>
  6594.         <autoSelect> <false /> </autoSelect>
  6595.         <showLines> <false /> </showLines>
  6596.         <wideMargins> <false /> </wideMargins>
  6597.         <multipleLines> <false /> </multipleLines>
  6598.         <reservedFamily> 0 </reservedFamily>
  6599.         <titleWidth>0</titleWidth>
  6600.         <icon>0</icon>
  6601.         <textAlign>right</textAlign>
  6602.         <font>Palatino</font>
  6603.         <textSize>10</textSize>
  6604.         <textStyle>plain</textStyle>
  6605.         <textHeight>13</textHeight>
  6606.         <name></name>
  6607.         <script></script>
  6608.     </part>
  6609.     <part>
  6610.         <id>119</id>
  6611.         <type>field</type>
  6612.         <visible> <true /> </visible>
  6613.         <dontWrap> <false /> </dontWrap>
  6614.         <dontSearch> <false /> </dontSearch>
  6615.         <sharedText> <false /> </sharedText>
  6616.         <fixedLineHeight> <true /> </fixedLineHeight>
  6617.         <autoTab> <false /> </autoTab>
  6618.         <lockText> <true /> </lockText>
  6619.         <rect>
  6620.             <left>275</left>
  6621.             <top>268</top>
  6622.             <right>494</right>
  6623.             <bottom>282</bottom>
  6624.         </rect>
  6625.         <style>transparent</style>
  6626.         <autoSelect> <false /> </autoSelect>
  6627.         <showLines> <false /> </showLines>
  6628.         <wideMargins> <false /> </wideMargins>
  6629.         <multipleLines> <false /> </multipleLines>
  6630.         <reservedFamily> 0 </reservedFamily>
  6631.         <titleWidth>0</titleWidth>
  6632.         <icon>0</icon>
  6633.         <textAlign>left</textAlign>
  6634.         <font>Palatino</font>
  6635.         <textSize>10</textSize>
  6636.         <textStyle>plain</textStyle>
  6637.         <textHeight>13</textHeight>
  6638.         <name></name>
  6639.         <script>on mouseUp
  6640. visual iris open
  6641. get the number of the target
  6642. get card field (it-1)
  6643. if it is not "" then
  6644. go card it
  6645. end if
  6646. end mouseUp
  6647. </script>
  6648.     </part>
  6649.     <part>
  6650.         <id>122</id>
  6651.         <type>field</type>
  6652.         <visible> <true /> </visible>
  6653.         <dontWrap> <false /> </dontWrap>
  6654.         <dontSearch> <false /> </dontSearch>
  6655.         <sharedText> <false /> </sharedText>
  6656.         <fixedLineHeight> <true /> </fixedLineHeight>
  6657.         <autoTab> <false /> </autoTab>
  6658.         <lockText> <true /> </lockText>
  6659.         <rect>
  6660.             <left>451</left>
  6661.             <top>281</top>
  6662.             <right>494</right>
  6663.             <bottom>295</bottom>
  6664.         </rect>
  6665.         <style>transparent</style>
  6666.         <autoSelect> <false /> </autoSelect>
  6667.         <showLines> <false /> </showLines>
  6668.         <wideMargins> <false /> </wideMargins>
  6669.         <multipleLines> <false /> </multipleLines>
  6670.         <reservedFamily> 0 </reservedFamily>
  6671.         <titleWidth>0</titleWidth>
  6672.         <icon>0</icon>
  6673.         <textAlign>right</textAlign>
  6674.         <font>Palatino</font>
  6675.         <textSize>10</textSize>
  6676.         <textStyle>plain</textStyle>
  6677.         <textHeight>13</textHeight>
  6678.         <name></name>
  6679.         <script></script>
  6680.     </part>
  6681.     <part>
  6682.         <id>121</id>
  6683.         <type>field</type>
  6684.         <visible> <true /> </visible>
  6685.         <dontWrap> <false /> </dontWrap>
  6686.         <dontSearch> <false /> </dontSearch>
  6687.         <sharedText> <false /> </sharedText>
  6688.         <fixedLineHeight> <true /> </fixedLineHeight>
  6689.         <autoTab> <false /> </autoTab>
  6690.         <lockText> <true /> </lockText>
  6691.         <rect>
  6692.             <left>275</left>
  6693.             <top>281</top>
  6694.             <right>494</right>
  6695.             <bottom>295</bottom>
  6696.         </rect>
  6697.         <style>transparent</style>
  6698.         <autoSelect> <false /> </autoSelect>
  6699.         <showLines> <false /> </showLines>
  6700.         <wideMargins> <false /> </wideMargins>
  6701.         <multipleLines> <false /> </multipleLines>
  6702.         <reservedFamily> 0 </reservedFamily>
  6703.         <titleWidth>0</titleWidth>
  6704.         <icon>0</icon>
  6705.         <textAlign>left</textAlign>
  6706.         <font>Palatino</font>
  6707.         <textSize>10</textSize>
  6708.         <textStyle>plain</textStyle>
  6709.         <textHeight>13</textHeight>
  6710.         <name></name>
  6711.         <script>on mouseUp
  6712. visual iris open
  6713. get the number of the target
  6714. get card field (it-1)
  6715. if it is not "" then
  6716. go card it
  6717. end if
  6718. end mouseUp
  6719. </script>
  6720.     </part>
  6721.     <part>
  6722.         <id>130</id>
  6723.         <type>button</type>
  6724.         <visible> <false /> </visible>
  6725.         <reserved5> 0 </reserved5>
  6726.         <reserved4> 0 </reserved4>
  6727.         <reserved3> 0 </reserved3>
  6728.         <reserved2> 0 </reserved2>
  6729.         <reserved1> 0 </reserved1>
  6730.         <enabled> <true /> </enabled>
  6731.         <rect>
  6732.             <left>352</left>
  6733.             <top>26</top>
  6734.             <right>475</right>
  6735.             <bottom>43</bottom>
  6736.         </rect>
  6737.         <style>roundrect</style>
  6738.         <showName> <true /> </showName>
  6739.         <highlight> <false /> </highlight>
  6740.         <autoHighlight> <true /> </autoHighlight>
  6741.         <sharedHighlight> <true /> </sharedHighlight>
  6742.         <family>0</family>
  6743.         <titleWidth>0</titleWidth>
  6744.         <icon>0</icon>
  6745.         <textAlign>center</textAlign>
  6746.         <font>Chicago</font>
  6747.         <textSize>12</textSize>
  6748.         <textStyle>plain</textStyle>
  6749.         <name>Add Contents Pg.</name>
  6750.         <script>on mouseUp
  6751. put the userLevel into currentLevel
  6752. set the userLevel to 5
  6753. doMenu "Copy Card"
  6754. doMenu "Paste Card"
  6755. put "" into field "page no"
  6756. send updateContents to this card
  6757. set the userLevel to currentLevel
  6758. end mouseUp
  6759. </script>
  6760.     </part>
  6761.     <content>
  6762.         <layer>background</layer>
  6763.         <id>7</id>
  6764.         <text>3</text>
  6765.     </content>
  6766.     <content>
  6767.         <layer>card</layer>
  6768.         <id>14</id>
  6769.         <text>card id 4342</text>
  6770.     </content>
  6771.     <content>
  6772.         <layer>background</layer>
  6773.         <id>4</id>
  6774.         <text>
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782. </text>
  6783.     </content>
  6784.     <content>
  6785.         <layer>card</layer>
  6786.         <id>24</id>
  6787.         <text>0</text>
  6788.     </content>
  6789.     <content>
  6790.         <layer>card</layer>
  6791.         <id>25</id>
  6792.         <text>0</text>
  6793.     </content>
  6794.     <content>
  6795.         <layer>card</layer>
  6796.         <id>62</id>
  6797.         <text>199</text>
  6798.     </content>
  6799.     <content>
  6800.         <layer>card</layer>
  6801.         <id>61</id>
  6802.         <text>    7.2  File Inclusion</text>
  6803.     </content>
  6804.     <content>
  6805.         <layer>card</layer>
  6806.         <id>37</id>
  6807.         <text>176</text>
  6808.     </content>
  6809.     <content>
  6810.         <layer>card</layer>
  6811.         <id>36</id>
  6812.         <text>    5.4  Bit Manipulation</text>
  6813.     </content>
  6814.     <content>
  6815.         <layer>card</layer>
  6816.         <id>33</id>
  6817.         <text>170</text>
  6818.     </content>
  6819.     <content>
  6820.         <layer>card</layer>
  6821.         <id>32</id>
  6822.         <text>    5.2  Logical Operators</text>
  6823.     </content>
  6824.     <content>
  6825.         <layer>card</layer>
  6826.         <id>50</id>
  6827.         <text>185</text>
  6828.     </content>
  6829.     <content>
  6830.         <layer>card</layer>
  6831.         <id>49</id>
  6832.         <text>    6.3  while/do-while</text>
  6833.     </content>
  6834.     <content>
  6835.         <layer>card</layer>
  6836.         <id>54</id>
  6837.         <text>190</text>
  6838.     </content>
  6839.     <content>
  6840.         <layer>card</layer>
  6841.         <id>53</id>
  6842.         <text>    6.5  goto</text>
  6843.     </content>
  6844.     <content>
  6845.         <layer>card</layer>
  6846.         <id>90</id>
  6847.         <text>210</text>
  6848.     </content>
  6849.     <content>
  6850.         <layer>card</layer>
  6851.         <id>89</id>
  6852.         <text>    8.1  I/O Functions</text>
  6853.     </content>
  6854.     <content>
  6855.         <layer>card</layer>
  6856.         <id>94</id>
  6857.         <text>216</text>
  6858.     </content>
  6859.     <content>
  6860.         <layer>card</layer>
  6861.         <id>93</id>
  6862.         <text>    8.3  String Handling Functions</text>
  6863.     </content>
  6864.     <content>
  6865.         <layer>card</layer>
  6866.         <id>48</id>
  6867.         <text>183</text>
  6868.     </content>
  6869.     <content>
  6870.         <layer>card</layer>
  6871.         <id>47</id>
  6872.         <text>    6.2  switch</text>
  6873.     </content>
  6874.     <content>
  6875.         <layer>card</layer>
  6876.         <id>102</id>
  6877.         <text>223</text>
  6878.     </content>
  6879.     <content>
  6880.         <layer>card</layer>
  6881.         <id>101</id>
  6882.         <text>    9.1  Code Reusability</text>
  6883.     </content>
  6884.     <content>
  6885.         <layer>card</layer>
  6886.         <id>35</id>
  6887.         <text>172</text>
  6888.     </content>
  6889.     <content>
  6890.         <layer>card</layer>
  6891.         <id>34</id>
  6892.         <text>    5.3  Type Conversion</text>
  6893.     </content>
  6894.     <content>
  6895.         <layer>card</layer>
  6896.         <id>52</id>
  6897.         <text>189</text>
  6898.     </content>
  6899.     <content>
  6900.         <layer>card</layer>
  6901.         <id>51</id>
  6902.         <text>    6.4  for</text>
  6903.     </content>
  6904.     <content>
  6905.         <layer>card</layer>
  6906.         <id>64</id>
  6907.         <text>205</text>
  6908.     </content>
  6909.     <content>
  6910.         <layer>card</layer>
  6911.         <id>63</id>
  6912.         <text>    7.3  Conditional Compilation</text>
  6913.     </content>
  6914.     <content>
  6915.         <layer>card</layer>
  6916.         <id>96</id>
  6917.         <text>219</text>
  6918.     </content>
  6919.     <content>
  6920.         <layer>card</layer>
  6921.         <id>95</id>
  6922.         <text>    8.4  Memory Management</text>
  6923.     </content>
  6924.     <content>
  6925.         <layer>card</layer>
  6926.         <id>106</id>
  6927.         <text>234</text>
  6928.     </content>
  6929.     <content>
  6930.         <layer>card</layer>
  6931.         <id>105</id>
  6932.         <text>    9.3  Class Libraries</text>
  6933.     </content>
  6934.     <content>
  6935.         <layer>card</layer>
  6936.         <id>112</id>
  6937.         <text>251</text>
  6938.     </content>
  6939.     <content>
  6940.         <layer>card</layer>
  6941.         <id>111</id>
  6942.         <text>Appendix 2.  C/TC/C++ Differences</text>
  6943.     </content>
  6944.     <content>
  6945.         <layer>card</layer>
  6946.         <id>31</id>
  6947.         <text>167</text>
  6948.     </content>
  6949.     <content>
  6950.         <layer>card</layer>
  6951.         <id>30</id>
  6952.         <text>    5.1  Arithmetic Operators</text>
  6953.     </content>
  6954.     <content>
  6955.         <layer>card</layer>
  6956.         <id>46</id>
  6957.         <text>180</text>
  6958.     </content>
  6959.     <content>
  6960.         <layer>card</layer>
  6961.         <id>45</id>
  6962.         <text>    6.1  if-else</text>
  6963.     </content>
  6964.     <content>
  6965.         <layer>card</layer>
  6966.         <id>60</id>
  6967.         <text>192</text>
  6968.     </content>
  6969.     <content>
  6970.         <layer>card</layer>
  6971.         <id>59</id>
  6972.         <text>    7.1  Text Substitution</text>
  6973.     </content>
  6974.     <content>
  6975.         <layer>card</layer>
  6976.         <id>92</id>
  6977.         <text>215</text>
  6978.     </content>
  6979.     <content>
  6980.         <layer>card</layer>
  6981.         <id>91</id>
  6982.         <text>    8.2  Math Functions</text>
  6983.     </content>
  6984.     <content>
  6985.         <layer>card</layer>
  6986.         <id>104</id>
  6987.         <text>226</text>
  6988.     </content>
  6989.     <content>
  6990.         <layer>card</layer>
  6991.         <id>103</id>
  6992.         <text>    9.2  Portability</text>
  6993.     </content>
  6994.     <content>
  6995.         <layer>card</layer>
  6996.         <id>29</id>
  6997.         <text>164</text>
  6998.     </content>
  6999.     <content>
  7000.         <layer>card</layer>
  7001.         <id>28</id>
  7002.         <text>5.  Operators  </text>
  7003.     </content>
  7004.     <content>
  7005.         <layer>card</layer>
  7006.         <id>44</id>
  7007.         <text>177</text>
  7008.     </content>
  7009.     <content>
  7010.         <layer>card</layer>
  7011.         <id>43</id>
  7012.         <text>6.  Statements</text>
  7013.     </content>
  7014.     <content>
  7015.         <layer>card</layer>
  7016.         <id>58</id>
  7017.         <text>191</text>
  7018.     </content>
  7019.     <content>
  7020.         <layer>card</layer>
  7021.         <id>57</id>
  7022.         <text>7.  Preprocessor Directives</text>
  7023.     </content>
  7024.     <content>
  7025.         <layer>card</layer>
  7026.         <id>84</id>
  7027.         <text>208</text>
  7028.     </content>
  7029.     <content>
  7030.         <layer>card</layer>
  7031.         <id>85</id>
  7032.         <text>8.  Standard Function Libraries</text>
  7033.     </content>
  7034.     <content>
  7035.         <layer>card</layer>
  7036.         <id>100</id>
  7037.         <text>222</text>
  7038.     </content>
  7039.     <content>
  7040.         <layer>card</layer>
  7041.         <id>99</id>
  7042.         <text>9.  Software Engineering</text>
  7043.     </content>
  7044.     <content>
  7045.         <layer>card</layer>
  7046.         <id>20</id>
  7047.         <text>(click on the topic or page no. of interest)</text>
  7048.     </content>
  7049.     <content>
  7050.         <layer>card</layer>
  7051.         <id>110</id>
  7052.         <text>248</text>
  7053.     </content>
  7054.     <content>
  7055.         <layer>card</layer>
  7056.         <id>109</id>
  7057.         <text>Appendix 1.  The Think C Project </text>
  7058.     </content>
  7059.     <content>
  7060.         <layer>card</layer>
  7061.         <id>116</id>
  7062.         <text>259</text>
  7063.     </content>
  7064.     <content>
  7065.         <layer>card</layer>
  7066.         <id>115</id>
  7067.         <text>Bibliography</text>
  7068.     </content>
  7069.     <content>
  7070.         <layer>card</layer>
  7071.         <id>120</id>
  7072.         <text>261</text>
  7073.     </content>
  7074.     <content>
  7075.         <layer>card</layer>
  7076.         <id>119</id>
  7077.         <text>Notes</text>
  7078.     </content>
  7079.     <name>contents (cont)</name>
  7080.     <script>on updateContents
  7081. global deletedCard
  7082. put 36*((the number of me)-(the number of card "contents")) into base
  7083. set cursor to watch
  7084. put 4 into firstField
  7085. repeat with x = 1 to 36
  7086. get line x+base of card field "content list" of card "contents"
  7087. if it is word 3 of deletedCard then
  7088. put "" into line x+base of card field "content list" of card "contents"
  7089. get ""
  7090. end if
  7091. if it is "" then
  7092. put "" into card field (2*x+firstField) of card (the number of me)
  7093. put "" into card field (2*x-1+firstField) of card (the number of me)
  7094. else
  7095. put the number of card id it into card field (2*x-1+firstField)¬¨
  7096. of card (the number of me)
  7097. put it into card field (2*x+firstField) of card (the number of me)
  7098. get field "heading" of card id it
  7099. put it into word 1 of card field (2*x+firstField)¬¨
  7100. of card (the number of me)
  7101. end if
  7102. end repeat
  7103. put (the number of me) + 1 into nextCard
  7104. get the name of card nextCard
  7105. get word 2 of it
  7106. get char 2 to 9 of it
  7107. if it is "contents" then
  7108. send updateContents to card nextCard
  7109. end if
  7110. end updateContents
  7111.  
  7112. </script>
  7113. </card>
  7114.  
  7115.  
  7116. card_9925.xml
  7117. <?xml version="1.0" encoding="utf-8" ?>
  7118. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  7119. <card>
  7120.     <id>9925</id>
  7121.     <filler1>0</filler1>
  7122.     <cantDelete> <true /> </cantDelete>
  7123.     <showPict> <true /> </showPict>
  7124.     <dontSearch> <false /> </dontSearch>
  7125.     <owner>4755</owner>
  7126.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  7127.     <part>
  7128.         <id>26</id>
  7129.         <type>button</type>
  7130.         <visible> <true /> </visible>
  7131.         <reserved5> 0 </reserved5>
  7132.         <reserved4> 0 </reserved4>
  7133.         <reserved3> 0 </reserved3>
  7134.         <reserved2> 0 </reserved2>
  7135.         <reserved1> 0 </reserved1>
  7136.         <enabled> <true /> </enabled>
  7137.         <rect>
  7138.             <left>7</left>
  7139.             <top>57</top>
  7140.             <right>502</right>
  7141.             <bottom>300</bottom>
  7142.         </rect>
  7143.         <style>transparent</style>
  7144.         <showName> <false /> </showName>
  7145.         <highlight> <false /> </highlight>
  7146.         <autoHighlight> <false /> </autoHighlight>
  7147.         <sharedHighlight> <true /> </sharedHighlight>
  7148.         <family>0</family>
  7149.         <titleWidth>0</titleWidth>
  7150.         <icon>0</icon>
  7151.         <textAlign>center</textAlign>
  7152.         <font>Chicago</font>
  7153.         <textSize>12</textSize>
  7154.         <textStyle>plain</textStyle>
  7155.         <name></name>
  7156.         <script></script>
  7157.     </part>
  7158.     <part>
  7159.         <id>14</id>
  7160.         <type>field</type>
  7161.         <visible> <false /> </visible>
  7162.         <dontWrap> <false /> </dontWrap>
  7163.         <dontSearch> <false /> </dontSearch>
  7164.         <sharedText> <false /> </sharedText>
  7165.         <fixedLineHeight> <true /> </fixedLineHeight>
  7166.         <autoTab> <false /> </autoTab>
  7167.         <lockText> <false /> </lockText>
  7168.         <rect>
  7169.             <left>141</left>
  7170.             <top>21</top>
  7171.             <right>237</right>
  7172.             <bottom>36</bottom>
  7173.         </rect>
  7174.         <style>transparent</style>
  7175.         <autoSelect> <false /> </autoSelect>
  7176.         <showLines> <false /> </showLines>
  7177.         <wideMargins> <false /> </wideMargins>
  7178.         <multipleLines> <false /> </multipleLines>
  7179.         <reservedFamily> 0 </reservedFamily>
  7180.         <titleWidth>0</titleWidth>
  7181.         <icon>0</icon>
  7182.         <textAlign>left</textAlign>
  7183.         <font>Palatino</font>
  7184.         <textSize>12</textSize>
  7185.         <textStyle>plain</textStyle>
  7186.         <textHeight>16</textHeight>
  7187.         <name>bookmark1</name>
  7188.         <script></script>
  7189.     </part>
  7190.     <part>
  7191.         <id>20</id>
  7192.         <type>field</type>
  7193.         <visible> <true /> </visible>
  7194.         <dontWrap> <false /> </dontWrap>
  7195.         <dontSearch> <false /> </dontSearch>
  7196.         <sharedText> <false /> </sharedText>
  7197.         <fixedLineHeight> <true /> </fixedLineHeight>
  7198.         <autoTab> <false /> </autoTab>
  7199.         <lockText> <true /> </lockText>
  7200.         <rect>
  7201.             <left>232</left>
  7202.             <top>37</top>
  7203.             <right>469</right>
  7204.             <bottom>55</bottom>
  7205.         </rect>
  7206.         <style>transparent</style>
  7207.         <autoSelect> <false /> </autoSelect>
  7208.         <showLines> <false /> </showLines>
  7209.         <wideMargins> <false /> </wideMargins>
  7210.         <multipleLines> <false /> </multipleLines>
  7211.         <reservedFamily> 0 </reservedFamily>
  7212.         <titleWidth>0</titleWidth>
  7213.         <icon>0</icon>
  7214.         <textAlign>left</textAlign>
  7215.         <font>Palatino</font>
  7216.         <textSize>10</textSize>
  7217.         <textStyle>plain</textStyle>
  7218.         <textHeight>13</textHeight>
  7219.         <name>instructions</name>
  7220.         <script></script>
  7221.     </part>
  7222.     <part>
  7223.         <id>24</id>
  7224.         <type>field</type>
  7225.         <visible> <false /> </visible>
  7226.         <dontWrap> <false /> </dontWrap>
  7227.         <dontSearch> <false /> </dontSearch>
  7228.         <sharedText> <false /> </sharedText>
  7229.         <fixedLineHeight> <true /> </fixedLineHeight>
  7230.         <autoTab> <false /> </autoTab>
  7231.         <lockText> <false /> </lockText>
  7232.         <rect>
  7233.             <left>237</left>
  7234.             <top>21</top>
  7235.             <right>333</right>
  7236.             <bottom>36</bottom>
  7237.         </rect>
  7238.         <style>transparent</style>
  7239.         <autoSelect> <false /> </autoSelect>
  7240.         <showLines> <false /> </showLines>
  7241.         <wideMargins> <false /> </wideMargins>
  7242.         <multipleLines> <false /> </multipleLines>
  7243.         <reservedFamily> 0 </reservedFamily>
  7244.         <titleWidth>0</titleWidth>
  7245.         <icon>0</icon>
  7246.         <textAlign>left</textAlign>
  7247.         <font>Palatino</font>
  7248.         <textSize>12</textSize>
  7249.         <textStyle>plain</textStyle>
  7250.         <textHeight>16</textHeight>
  7251.         <name>bookmark2</name>
  7252.         <script></script>
  7253.     </part>
  7254.     <part>
  7255.         <id>25</id>
  7256.         <type>field</type>
  7257.         <visible> <false /> </visible>
  7258.         <dontWrap> <false /> </dontWrap>
  7259.         <dontSearch> <false /> </dontSearch>
  7260.         <sharedText> <false /> </sharedText>
  7261.         <fixedLineHeight> <true /> </fixedLineHeight>
  7262.         <autoTab> <false /> </autoTab>
  7263.         <lockText> <false /> </lockText>
  7264.         <rect>
  7265.             <left>333</left>
  7266.             <top>21</top>
  7267.             <right>429</right>
  7268.             <bottom>36</bottom>
  7269.         </rect>
  7270.         <style>transparent</style>
  7271.         <autoSelect> <false /> </autoSelect>
  7272.         <showLines> <false /> </showLines>
  7273.         <wideMargins> <false /> </wideMargins>
  7274.         <multipleLines> <false /> </multipleLines>
  7275.         <reservedFamily> 0 </reservedFamily>
  7276.         <titleWidth>0</titleWidth>
  7277.         <icon>0</icon>
  7278.         <textAlign>left</textAlign>
  7279.         <font>Palatino</font>
  7280.         <textSize>12</textSize>
  7281.         <textStyle>plain</textStyle>
  7282.         <textHeight>16</textHeight>
  7283.         <name>bookmark3</name>
  7284.         <script></script>
  7285.     </part>
  7286.     <part>
  7287.         <id>29</id>
  7288.         <type>field</type>
  7289.         <visible> <true /> </visible>
  7290.         <dontWrap> <false /> </dontWrap>
  7291.         <dontSearch> <false /> </dontSearch>
  7292.         <sharedText> <false /> </sharedText>
  7293.         <fixedLineHeight> <true /> </fixedLineHeight>
  7294.         <autoTab> <false /> </autoTab>
  7295.         <lockText> <true /> </lockText>
  7296.         <rect>
  7297.             <left>451</left>
  7298.             <top>60</top>
  7299.             <right>494</right>
  7300.             <bottom>74</bottom>
  7301.         </rect>
  7302.         <style>transparent</style>
  7303.         <autoSelect> <false /> </autoSelect>
  7304.         <showLines> <false /> </showLines>
  7305.         <wideMargins> <false /> </wideMargins>
  7306.         <multipleLines> <false /> </multipleLines>
  7307.         <reservedFamily> 0 </reservedFamily>
  7308.         <titleWidth>0</titleWidth>
  7309.         <icon>0</icon>
  7310.         <textAlign>right</textAlign>
  7311.         <font>Palatino</font>
  7312.         <textSize>10</textSize>
  7313.         <textStyle>plain</textStyle>
  7314.         <textHeight>13</textHeight>
  7315.         <name></name>
  7316.         <script></script>
  7317.     </part>
  7318.     <part>
  7319.         <id>28</id>
  7320.         <type>field</type>
  7321.         <visible> <true /> </visible>
  7322.         <dontWrap> <false /> </dontWrap>
  7323.         <dontSearch> <false /> </dontSearch>
  7324.         <sharedText> <false /> </sharedText>
  7325.         <fixedLineHeight> <true /> </fixedLineHeight>
  7326.         <autoTab> <false /> </autoTab>
  7327.         <lockText> <true /> </lockText>
  7328.         <rect>
  7329.             <left>14</left>
  7330.             <top>60</top>
  7331.             <right>494</right>
  7332.             <bottom>74</bottom>
  7333.         </rect>
  7334.         <style>transparent</style>
  7335.         <autoSelect> <false /> </autoSelect>
  7336.         <showLines> <false /> </showLines>
  7337.         <wideMargins> <false /> </wideMargins>
  7338.         <multipleLines> <false /> </multipleLines>
  7339.         <reservedFamily> 0 </reservedFamily>
  7340.         <titleWidth>0</titleWidth>
  7341.         <icon>0</icon>
  7342.         <textAlign>left</textAlign>
  7343.         <font>Palatino</font>
  7344.         <textSize>10</textSize>
  7345.         <textStyle>plain</textStyle>
  7346.         <textHeight>13</textHeight>
  7347.         <name></name>
  7348.         <script>on mouseUp
  7349. visual iris open
  7350. get the number of the target
  7351. get card field (it-1)
  7352. if it is not "" then
  7353. -- added following to return to card
  7354. global xrefdepth
  7355. add 1 to xrefdepth
  7356. push card
  7357. show background button "return"
  7358. go card it
  7359. end if
  7360. end mouseUp
  7361. </script>
  7362.     </part>
  7363.     <part>
  7364.         <id>31</id>
  7365.         <type>field</type>
  7366.         <visible> <true /> </visible>
  7367.         <dontWrap> <false /> </dontWrap>
  7368.         <dontSearch> <false /> </dontSearch>
  7369.         <sharedText> <false /> </sharedText>
  7370.         <fixedLineHeight> <true /> </fixedLineHeight>
  7371.         <autoTab> <false /> </autoTab>
  7372.         <lockText> <true /> </lockText>
  7373.         <rect>
  7374.             <left>451</left>
  7375.             <top>73</top>
  7376.             <right>494</right>
  7377.             <bottom>87</bottom>
  7378.         </rect>
  7379.         <style>transparent</style>
  7380.         <autoSelect> <false /> </autoSelect>
  7381.         <showLines> <false /> </showLines>
  7382.         <wideMargins> <false /> </wideMargins>
  7383.         <multipleLines> <false /> </multipleLines>
  7384.         <reservedFamily> 0 </reservedFamily>
  7385.         <titleWidth>0</titleWidth>
  7386.         <icon>0</icon>
  7387.         <textAlign>right</textAlign>
  7388.         <font>Palatino</font>
  7389.         <textSize>10</textSize>
  7390.         <textStyle>plain</textStyle>
  7391.         <textHeight>13</textHeight>
  7392.         <name></name>
  7393.         <script></script>
  7394.     </part>
  7395.     <part>
  7396.         <id>30</id>
  7397.         <type>field</type>
  7398.         <visible> <true /> </visible>
  7399.         <dontWrap> <false /> </dontWrap>
  7400.         <dontSearch> <false /> </dontSearch>
  7401.         <sharedText> <false /> </sharedText>
  7402.         <fixedLineHeight> <true /> </fixedLineHeight>
  7403.         <autoTab> <false /> </autoTab>
  7404.         <lockText> <true /> </lockText>
  7405.         <rect>
  7406.             <left>14</left>
  7407.             <top>73</top>
  7408.             <right>494</right>
  7409.             <bottom>87</bottom>
  7410.         </rect>
  7411.         <style>transparent</style>
  7412.         <autoSelect> <false /> </autoSelect>
  7413.         <showLines> <false /> </showLines>
  7414.         <wideMargins> <false /> </wideMargins>
  7415.         <multipleLines> <false /> </multipleLines>
  7416.         <reservedFamily> 0 </reservedFamily>
  7417.         <titleWidth>0</titleWidth>
  7418.         <icon>0</icon>
  7419.         <textAlign>left</textAlign>
  7420.         <font>Palatino</font>
  7421.         <textSize>10</textSize>
  7422.         <textStyle>plain</textStyle>
  7423.         <textHeight>13</textHeight>
  7424.         <name></name>
  7425.         <script>on mouseUp
  7426. visual iris open
  7427. get the number of the target
  7428. get card field (it-1)
  7429. if it is not "" then
  7430. -- added following to return to card
  7431. global xrefdepth
  7432. add 1 to xrefdepth
  7433. push card
  7434. show background button "return"
  7435. go card it
  7436. end if
  7437. end mouseUp
  7438. </script>
  7439.     </part>
  7440.     <part>
  7441.         <id>33</id>
  7442.         <type>field</type>
  7443.         <visible> <true /> </visible>
  7444.         <dontWrap> <false /> </dontWrap>
  7445.         <dontSearch> <false /> </dontSearch>
  7446.         <sharedText> <false /> </sharedText>
  7447.         <fixedLineHeight> <true /> </fixedLineHeight>
  7448.         <autoTab> <false /> </autoTab>
  7449.         <lockText> <true /> </lockText>
  7450.         <rect>
  7451.             <left>451</left>
  7452.             <top>86</top>
  7453.             <right>494</right>
  7454.             <bottom>100</bottom>
  7455.         </rect>
  7456.         <style>transparent</style>
  7457.         <autoSelect> <false /> </autoSelect>
  7458.         <showLines> <false /> </showLines>
  7459.         <wideMargins> <false /> </wideMargins>
  7460.         <multipleLines> <false /> </multipleLines>
  7461.         <reservedFamily> 0 </reservedFamily>
  7462.         <titleWidth>0</titleWidth>
  7463.         <icon>0</icon>
  7464.         <textAlign>right</textAlign>
  7465.         <font>Palatino</font>
  7466.         <textSize>10</textSize>
  7467.         <textStyle>plain</textStyle>
  7468.         <textHeight>13</textHeight>
  7469.         <name></name>
  7470.         <script></script>
  7471.     </part>
  7472.     <part>
  7473.         <id>32</id>
  7474.         <type>field</type>
  7475.         <visible> <true /> </visible>
  7476.         <dontWrap> <false /> </dontWrap>
  7477.         <dontSearch> <false /> </dontSearch>
  7478.         <sharedText> <false /> </sharedText>
  7479.         <fixedLineHeight> <true /> </fixedLineHeight>
  7480.         <autoTab> <false /> </autoTab>
  7481.         <lockText> <true /> </lockText>
  7482.         <rect>
  7483.             <left>14</left>
  7484.             <top>86</top>
  7485.             <right>494</right>
  7486.             <bottom>100</bottom>
  7487.         </rect>
  7488.         <style>transparent</style>
  7489.         <autoSelect> <false /> </autoSelect>
  7490.         <showLines> <false /> </showLines>
  7491.         <wideMargins> <false /> </wideMargins>
  7492.         <multipleLines> <false /> </multipleLines>
  7493.         <reservedFamily> 0 </reservedFamily>
  7494.         <titleWidth>0</titleWidth>
  7495.         <icon>0</icon>
  7496.         <textAlign>left</textAlign>
  7497.         <font>Palatino</font>
  7498.         <textSize>10</textSize>
  7499.         <textStyle>plain</textStyle>
  7500.         <textHeight>13</textHeight>
  7501.         <name></name>
  7502.         <script>on mouseUp
  7503. visual iris open
  7504. get the number of the target
  7505. get card field (it-1)
  7506. if it is not "" then
  7507. -- added following to return to card
  7508. global xrefdepth
  7509. add 1 to xrefdepth
  7510. push card
  7511. show background button "return"
  7512. go card it
  7513. end if
  7514. end mouseUp
  7515. </script>
  7516.     </part>
  7517.     <part>
  7518.         <id>35</id>
  7519.         <type>field</type>
  7520.         <visible> <true /> </visible>
  7521.         <dontWrap> <false /> </dontWrap>
  7522.         <dontSearch> <false /> </dontSearch>
  7523.         <sharedText> <false /> </sharedText>
  7524.         <fixedLineHeight> <true /> </fixedLineHeight>
  7525.         <autoTab> <false /> </autoTab>
  7526.         <lockText> <true /> </lockText>
  7527.         <rect>
  7528.             <left>451</left>
  7529.             <top>99</top>
  7530.             <right>494</right>
  7531.             <bottom>113</bottom>
  7532.         </rect>
  7533.         <style>transparent</style>
  7534.         <autoSelect> <false /> </autoSelect>
  7535.         <showLines> <false /> </showLines>
  7536.         <wideMargins> <false /> </wideMargins>
  7537.         <multipleLines> <false /> </multipleLines>
  7538.         <reservedFamily> 0 </reservedFamily>
  7539.         <titleWidth>0</titleWidth>
  7540.         <icon>0</icon>
  7541.         <textAlign>right</textAlign>
  7542.         <font>Palatino</font>
  7543.         <textSize>10</textSize>
  7544.         <textStyle>plain</textStyle>
  7545.         <textHeight>13</textHeight>
  7546.         <name></name>
  7547.         <script></script>
  7548.     </part>
  7549.     <part>
  7550.         <id>34</id>
  7551.         <type>field</type>
  7552.         <visible> <true /> </visible>
  7553.         <dontWrap> <false /> </dontWrap>
  7554.         <dontSearch> <false /> </dontSearch>
  7555.         <sharedText> <false /> </sharedText>
  7556.         <fixedLineHeight> <true /> </fixedLineHeight>
  7557.         <autoTab> <false /> </autoTab>
  7558.         <lockText> <true /> </lockText>
  7559.         <rect>
  7560.             <left>14</left>
  7561.             <top>99</top>
  7562.             <right>494</right>
  7563.             <bottom>113</bottom>
  7564.         </rect>
  7565.         <style>transparent</style>
  7566.         <autoSelect> <false /> </autoSelect>
  7567.         <showLines> <false /> </showLines>
  7568.         <wideMargins> <false /> </wideMargins>
  7569.         <multipleLines> <false /> </multipleLines>
  7570.         <reservedFamily> 0 </reservedFamily>
  7571.         <titleWidth>0</titleWidth>
  7572.         <icon>0</icon>
  7573.         <textAlign>left</textAlign>
  7574.         <font>Palatino</font>
  7575.         <textSize>10</textSize>
  7576.         <textStyle>plain</textStyle>
  7577.         <textHeight>13</textHeight>
  7578.         <name></name>
  7579.         <script>on mouseUp
  7580. visual iris open
  7581. get the number of the target
  7582. get card field (it-1)
  7583. if it is not "" then
  7584. -- added following to return to card
  7585. global xrefdepth
  7586. add 1 to xrefdepth
  7587. push card
  7588. show background button "return"
  7589. go card it
  7590. end if
  7591. end mouseUp
  7592. </script>
  7593.     </part>
  7594.     <part>
  7595.         <id>37</id>
  7596.         <type>field</type>
  7597.         <visible> <true /> </visible>
  7598.         <dontWrap> <false /> </dontWrap>
  7599.         <dontSearch> <false /> </dontSearch>
  7600.         <sharedText> <false /> </sharedText>
  7601.         <fixedLineHeight> <true /> </fixedLineHeight>
  7602.         <autoTab> <false /> </autoTab>
  7603.         <lockText> <true /> </lockText>
  7604.         <rect>
  7605.             <left>451</left>
  7606.             <top>112</top>
  7607.             <right>494</right>
  7608.             <bottom>126</bottom>
  7609.         </rect>
  7610.         <style>transparent</style>
  7611.         <autoSelect> <false /> </autoSelect>
  7612.         <showLines> <false /> </showLines>
  7613.         <wideMargins> <false /> </wideMargins>
  7614.         <multipleLines> <false /> </multipleLines>
  7615.         <reservedFamily> 0 </reservedFamily>
  7616.         <titleWidth>0</titleWidth>
  7617.         <icon>0</icon>
  7618.         <textAlign>right</textAlign>
  7619.         <font>Palatino</font>
  7620.         <textSize>10</textSize>
  7621.         <textStyle>plain</textStyle>
  7622.         <textHeight>13</textHeight>
  7623.         <name></name>
  7624.         <script></script>
  7625.     </part>
  7626.     <part>
  7627.         <id>36</id>
  7628.         <type>field</type>
  7629.         <visible> <true /> </visible>
  7630.         <dontWrap> <false /> </dontWrap>
  7631.         <dontSearch> <false /> </dontSearch>
  7632.         <sharedText> <false /> </sharedText>
  7633.         <fixedLineHeight> <true /> </fixedLineHeight>
  7634.         <autoTab> <false /> </autoTab>
  7635.         <lockText> <true /> </lockText>
  7636.         <rect>
  7637.             <left>14</left>
  7638.             <top>112</top>
  7639.             <right>494</right>
  7640.             <bottom>126</bottom>
  7641.         </rect>
  7642.         <style>transparent</style>
  7643.         <autoSelect> <false /> </autoSelect>
  7644.         <showLines> <false /> </showLines>
  7645.         <wideMargins> <false /> </wideMargins>
  7646.         <multipleLines> <false /> </multipleLines>
  7647.         <reservedFamily> 0 </reservedFamily>
  7648.         <titleWidth>0</titleWidth>
  7649.         <icon>0</icon>
  7650.         <textAlign>left</textAlign>
  7651.         <font>Palatino</font>
  7652.         <textSize>10</textSize>
  7653.         <textStyle>plain</textStyle>
  7654.         <textHeight>13</textHeight>
  7655.         <name></name>
  7656.         <script>on mouseUp
  7657. visual iris open
  7658. get the number of the target
  7659. get card field (it-1)
  7660. if it is not "" then
  7661. -- added following to return to card
  7662. global xrefdepth
  7663. add 1 to xrefdepth
  7664. push card
  7665. show background button "return"
  7666. go card it
  7667. end if
  7668. end mouseUp
  7669. </script>
  7670.     </part>
  7671.     <part>
  7672.         <id>39</id>
  7673.         <type>field</type>
  7674.         <visible> <true /> </visible>
  7675.         <dontWrap> <false /> </dontWrap>
  7676.         <dontSearch> <false /> </dontSearch>
  7677.         <sharedText> <false /> </sharedText>
  7678.         <fixedLineHeight> <true /> </fixedLineHeight>
  7679.         <autoTab> <false /> </autoTab>
  7680.         <lockText> <true /> </lockText>
  7681.         <rect>
  7682.             <left>451</left>
  7683.             <top>125</top>
  7684.             <right>494</right>
  7685.             <bottom>139</bottom>
  7686.         </rect>
  7687.         <style>transparent</style>
  7688.         <autoSelect> <false /> </autoSelect>
  7689.         <showLines> <false /> </showLines>
  7690.         <wideMargins> <false /> </wideMargins>
  7691.         <multipleLines> <false /> </multipleLines>
  7692.         <reservedFamily> 0 </reservedFamily>
  7693.         <titleWidth>0</titleWidth>
  7694.         <icon>0</icon>
  7695.         <textAlign>right</textAlign>
  7696.         <font>Palatino</font>
  7697.         <textSize>10</textSize>
  7698.         <textStyle>plain</textStyle>
  7699.         <textHeight>13</textHeight>
  7700.         <name></name>
  7701.         <script></script>
  7702.     </part>
  7703.     <part>
  7704.         <id>38</id>
  7705.         <type>field</type>
  7706.         <visible> <true /> </visible>
  7707.         <dontWrap> <false /> </dontWrap>
  7708.         <dontSearch> <false /> </dontSearch>
  7709.         <sharedText> <false /> </sharedText>
  7710.         <fixedLineHeight> <true /> </fixedLineHeight>
  7711.         <autoTab> <false /> </autoTab>
  7712.         <lockText> <true /> </lockText>
  7713.         <rect>
  7714.             <left>14</left>
  7715.             <top>125</top>
  7716.             <right>494</right>
  7717.             <bottom>139</bottom>
  7718.         </rect>
  7719.         <style>transparent</style>
  7720.         <autoSelect> <false /> </autoSelect>
  7721.         <showLines> <false /> </showLines>
  7722.         <wideMargins> <false /> </wideMargins>
  7723.         <multipleLines> <false /> </multipleLines>
  7724.         <reservedFamily> 0 </reservedFamily>
  7725.         <titleWidth>0</titleWidth>
  7726.         <icon>0</icon>
  7727.         <textAlign>left</textAlign>
  7728.         <font>Palatino</font>
  7729.         <textSize>10</textSize>
  7730.         <textStyle>plain</textStyle>
  7731.         <textHeight>13</textHeight>
  7732.         <name></name>
  7733.         <script>on mouseUp
  7734. visual iris open
  7735. get the number of the target
  7736. get card field (it-1)
  7737. if it is not "" then
  7738. -- added following to return to card
  7739. global xrefdepth
  7740. add 1 to xrefdepth
  7741. push card
  7742. show background button "return"
  7743. go card it
  7744. end if
  7745. end mouseUp
  7746. </script>
  7747.     </part>
  7748.     <part>
  7749.         <id>44</id>
  7750.         <type>field</type>
  7751.         <visible> <true /> </visible>
  7752.         <dontWrap> <false /> </dontWrap>
  7753.         <dontSearch> <false /> </dontSearch>
  7754.         <sharedText> <false /> </sharedText>
  7755.         <fixedLineHeight> <true /> </fixedLineHeight>
  7756.         <autoTab> <false /> </autoTab>
  7757.         <lockText> <true /> </lockText>
  7758.         <rect>
  7759.             <left>451</left>
  7760.             <top>138</top>
  7761.             <right>494</right>
  7762.             <bottom>151</bottom>
  7763.         </rect>
  7764.         <style>transparent</style>
  7765.         <autoSelect> <false /> </autoSelect>
  7766.         <showLines> <false /> </showLines>
  7767.         <wideMargins> <false /> </wideMargins>
  7768.         <multipleLines> <false /> </multipleLines>
  7769.         <reservedFamily> 0 </reservedFamily>
  7770.         <titleWidth>0</titleWidth>
  7771.         <icon>0</icon>
  7772.         <textAlign>right</textAlign>
  7773.         <font>Palatino</font>
  7774.         <textSize>10</textSize>
  7775.         <textStyle>plain</textStyle>
  7776.         <textHeight>13</textHeight>
  7777.         <name></name>
  7778.         <script></script>
  7779.     </part>
  7780.     <part>
  7781.         <id>43</id>
  7782.         <type>field</type>
  7783.         <visible> <true /> </visible>
  7784.         <dontWrap> <false /> </dontWrap>
  7785.         <dontSearch> <false /> </dontSearch>
  7786.         <sharedText> <false /> </sharedText>
  7787.         <fixedLineHeight> <true /> </fixedLineHeight>
  7788.         <autoTab> <false /> </autoTab>
  7789.         <lockText> <true /> </lockText>
  7790.         <rect>
  7791.             <left>14</left>
  7792.             <top>138</top>
  7793.             <right>494</right>
  7794.             <bottom>152</bottom>
  7795.         </rect>
  7796.         <style>transparent</style>
  7797.         <autoSelect> <false /> </autoSelect>
  7798.         <showLines> <false /> </showLines>
  7799.         <wideMargins> <false /> </wideMargins>
  7800.         <multipleLines> <false /> </multipleLines>
  7801.         <reservedFamily> 0 </reservedFamily>
  7802.         <titleWidth>0</titleWidth>
  7803.         <icon>0</icon>
  7804.         <textAlign>left</textAlign>
  7805.         <font>Palatino</font>
  7806.         <textSize>10</textSize>
  7807.         <textStyle>plain</textStyle>
  7808.         <textHeight>13</textHeight>
  7809.         <name></name>
  7810.         <script>on mouseUp
  7811. visual iris open
  7812. get the number of the target
  7813. get card field (it-1)
  7814. if it is not "" then
  7815. -- added following to return to card
  7816. global xrefdepth
  7817. add 1 to xrefdepth
  7818. push card
  7819. show background button "return"
  7820. go card it
  7821. end if
  7822. end mouseUp
  7823. </script>
  7824.     </part>
  7825.     <part>
  7826.         <id>46</id>
  7827.         <type>field</type>
  7828.         <visible> <true /> </visible>
  7829.         <dontWrap> <false /> </dontWrap>
  7830.         <dontSearch> <false /> </dontSearch>
  7831.         <sharedText> <false /> </sharedText>
  7832.         <fixedLineHeight> <true /> </fixedLineHeight>
  7833.         <autoTab> <false /> </autoTab>
  7834.         <lockText> <true /> </lockText>
  7835.         <rect>
  7836.             <left>451</left>
  7837.             <top>151</top>
  7838.             <right>494</right>
  7839.             <bottom>165</bottom>
  7840.         </rect>
  7841.         <style>transparent</style>
  7842.         <autoSelect> <false /> </autoSelect>
  7843.         <showLines> <false /> </showLines>
  7844.         <wideMargins> <false /> </wideMargins>
  7845.         <multipleLines> <false /> </multipleLines>
  7846.         <reservedFamily> 0 </reservedFamily>
  7847.         <titleWidth>0</titleWidth>
  7848.         <icon>0</icon>
  7849.         <textAlign>right</textAlign>
  7850.         <font>Palatino</font>
  7851.         <textSize>10</textSize>
  7852.         <textStyle>plain</textStyle>
  7853.         <textHeight>13</textHeight>
  7854.         <name></name>
  7855.         <script></script>
  7856.     </part>
  7857.     <part>
  7858.         <id>45</id>
  7859.         <type>field</type>
  7860.         <visible> <true /> </visible>
  7861.         <dontWrap> <false /> </dontWrap>
  7862.         <dontSearch> <false /> </dontSearch>
  7863.         <sharedText> <false /> </sharedText>
  7864.         <fixedLineHeight> <true /> </fixedLineHeight>
  7865.         <autoTab> <false /> </autoTab>
  7866.         <lockText> <true /> </lockText>
  7867.         <rect>
  7868.             <left>14</left>
  7869.             <top>151</top>
  7870.             <right>494</right>
  7871.             <bottom>165</bottom>
  7872.         </rect>
  7873.         <style>transparent</style>
  7874.         <autoSelect> <false /> </autoSelect>
  7875.         <showLines> <false /> </showLines>
  7876.         <wideMargins> <false /> </wideMargins>
  7877.         <multipleLines> <false /> </multipleLines>
  7878.         <reservedFamily> 0 </reservedFamily>
  7879.         <titleWidth>0</titleWidth>
  7880.         <icon>0</icon>
  7881.         <textAlign>left</textAlign>
  7882.         <font>Palatino</font>
  7883.         <textSize>10</textSize>
  7884.         <textStyle>plain</textStyle>
  7885.         <textHeight>13</textHeight>
  7886.         <name></name>
  7887.         <script>on mouseUp
  7888. visual iris open
  7889. get the number of the target
  7890. get card field (it-1)
  7891. if it is not "" then
  7892. -- added following to return to card
  7893. global xrefdepth
  7894. add 1 to xrefdepth
  7895. push card
  7896. show background button "return"
  7897. go card it
  7898. end if
  7899. end mouseUp
  7900. </script>
  7901.     </part>
  7902.     <part>
  7903.         <id>48</id>
  7904.         <type>field</type>
  7905.         <visible> <true /> </visible>
  7906.         <dontWrap> <false /> </dontWrap>
  7907.         <dontSearch> <false /> </dontSearch>
  7908.         <sharedText> <false /> </sharedText>
  7909.         <fixedLineHeight> <true /> </fixedLineHeight>
  7910.         <autoTab> <false /> </autoTab>
  7911.         <lockText> <true /> </lockText>
  7912.         <rect>
  7913.             <left>451</left>
  7914.             <top>164</top>
  7915.             <right>494</right>
  7916.             <bottom>178</bottom>
  7917.         </rect>
  7918.         <style>transparent</style>
  7919.         <autoSelect> <false /> </autoSelect>
  7920.         <showLines> <false /> </showLines>
  7921.         <wideMargins> <false /> </wideMargins>
  7922.         <multipleLines> <false /> </multipleLines>
  7923.         <reservedFamily> 0 </reservedFamily>
  7924.         <titleWidth>0</titleWidth>
  7925.         <icon>0</icon>
  7926.         <textAlign>right</textAlign>
  7927.         <font>Palatino</font>
  7928.         <textSize>10</textSize>
  7929.         <textStyle>plain</textStyle>
  7930.         <textHeight>13</textHeight>
  7931.         <name></name>
  7932.         <script></script>
  7933.     </part>
  7934.     <part>
  7935.         <id>47</id>
  7936.         <type>field</type>
  7937.         <visible> <true /> </visible>
  7938.         <dontWrap> <false /> </dontWrap>
  7939.         <dontSearch> <false /> </dontSearch>
  7940.         <sharedText> <false /> </sharedText>
  7941.         <fixedLineHeight> <true /> </fixedLineHeight>
  7942.         <autoTab> <false /> </autoTab>
  7943.         <lockText> <true /> </lockText>
  7944.         <rect>
  7945.             <left>14</left>
  7946.             <top>164</top>
  7947.             <right>494</right>
  7948.             <bottom>178</bottom>
  7949.         </rect>
  7950.         <style>transparent</style>
  7951.         <autoSelect> <false /> </autoSelect>
  7952.         <showLines> <false /> </showLines>
  7953.         <wideMargins> <false /> </wideMargins>
  7954.         <multipleLines> <false /> </multipleLines>
  7955.         <reservedFamily> 0 </reservedFamily>
  7956.         <titleWidth>0</titleWidth>
  7957.         <icon>0</icon>
  7958.         <textAlign>left</textAlign>
  7959.         <font>Palatino</font>
  7960.         <textSize>10</textSize>
  7961.         <textStyle>plain</textStyle>
  7962.         <textHeight>13</textHeight>
  7963.         <name></name>
  7964.         <script>on mouseUp
  7965. visual iris open
  7966. get the number of the target
  7967. get card field (it-1)
  7968. if it is not "" then
  7969. -- added following to return to card
  7970. global xrefdepth
  7971. add 1 to xrefdepth
  7972. push card
  7973. show background button "return"
  7974. go card it
  7975. end if
  7976. end mouseUp
  7977. </script>
  7978.     </part>
  7979.     <part>
  7980.         <id>50</id>
  7981.         <type>field</type>
  7982.         <visible> <true /> </visible>
  7983.         <dontWrap> <false /> </dontWrap>
  7984.         <dontSearch> <false /> </dontSearch>
  7985.         <sharedText> <false /> </sharedText>
  7986.         <fixedLineHeight> <true /> </fixedLineHeight>
  7987.         <autoTab> <false /> </autoTab>
  7988.         <lockText> <true /> </lockText>
  7989.         <rect>
  7990.             <left>451</left>
  7991.             <top>177</top>
  7992.             <right>494</right>
  7993.             <bottom>191</bottom>
  7994.         </rect>
  7995.         <style>transparent</style>
  7996.         <autoSelect> <false /> </autoSelect>
  7997.         <showLines> <false /> </showLines>
  7998.         <wideMargins> <false /> </wideMargins>
  7999.         <multipleLines> <false /> </multipleLines>
  8000.         <reservedFamily> 0 </reservedFamily>
  8001.         <titleWidth>0</titleWidth>
  8002.         <icon>0</icon>
  8003.         <textAlign>right</textAlign>
  8004.         <font>Palatino</font>
  8005.         <textSize>10</textSize>
  8006.         <textStyle>plain</textStyle>
  8007.         <textHeight>13</textHeight>
  8008.         <name></name>
  8009.         <script></script>
  8010.     </part>
  8011.     <part>
  8012.         <id>49</id>
  8013.         <type>field</type>
  8014.         <visible> <true /> </visible>
  8015.         <dontWrap> <false /> </dontWrap>
  8016.         <dontSearch> <false /> </dontSearch>
  8017.         <sharedText> <false /> </sharedText>
  8018.         <fixedLineHeight> <true /> </fixedLineHeight>
  8019.         <autoTab> <false /> </autoTab>
  8020.         <lockText> <true /> </lockText>
  8021.         <rect>
  8022.             <left>14</left>
  8023.             <top>177</top>
  8024.             <right>494</right>
  8025.             <bottom>191</bottom>
  8026.         </rect>
  8027.         <style>transparent</style>
  8028.         <autoSelect> <false /> </autoSelect>
  8029.         <showLines> <false /> </showLines>
  8030.         <wideMargins> <false /> </wideMargins>
  8031.         <multipleLines> <false /> </multipleLines>
  8032.         <reservedFamily> 0 </reservedFamily>
  8033.         <titleWidth>0</titleWidth>
  8034.         <icon>0</icon>
  8035.         <textAlign>left</textAlign>
  8036.         <font>Palatino</font>
  8037.         <textSize>10</textSize>
  8038.         <textStyle>plain</textStyle>
  8039.         <textHeight>13</textHeight>
  8040.         <name></name>
  8041.         <script>on mouseUp
  8042. visual iris open
  8043. get the number of the target
  8044. get card field (it-1)
  8045. if it is not "" then
  8046. -- added following to return to card
  8047. global xrefdepth
  8048. add 1 to xrefdepth
  8049. push card
  8050. show background button "return"
  8051. go card it
  8052. end if
  8053. end mouseUp
  8054. </script>
  8055.     </part>
  8056.     <part>
  8057.         <id>52</id>
  8058.         <type>field</type>
  8059.         <visible> <true /> </visible>
  8060.         <dontWrap> <false /> </dontWrap>
  8061.         <dontSearch> <false /> </dontSearch>
  8062.         <sharedText> <false /> </sharedText>
  8063.         <fixedLineHeight> <true /> </fixedLineHeight>
  8064.         <autoTab> <false /> </autoTab>
  8065.         <lockText> <true /> </lockText>
  8066.         <rect>
  8067.             <left>451</left>
  8068.             <top>190</top>
  8069.             <right>494</right>
  8070.             <bottom>203</bottom>
  8071.         </rect>
  8072.         <style>transparent</style>
  8073.         <autoSelect> <false /> </autoSelect>
  8074.         <showLines> <false /> </showLines>
  8075.         <wideMargins> <false /> </wideMargins>
  8076.         <multipleLines> <false /> </multipleLines>
  8077.         <reservedFamily> 0 </reservedFamily>
  8078.         <titleWidth>0</titleWidth>
  8079.         <icon>0</icon>
  8080.         <textAlign>right</textAlign>
  8081.         <font>Palatino</font>
  8082.         <textSize>10</textSize>
  8083.         <textStyle>plain</textStyle>
  8084.         <textHeight>13</textHeight>
  8085.         <name></name>
  8086.         <script></script>
  8087.     </part>
  8088.     <part>
  8089.         <id>51</id>
  8090.         <type>field</type>
  8091.         <visible> <true /> </visible>
  8092.         <dontWrap> <false /> </dontWrap>
  8093.         <dontSearch> <false /> </dontSearch>
  8094.         <sharedText> <false /> </sharedText>
  8095.         <fixedLineHeight> <true /> </fixedLineHeight>
  8096.         <autoTab> <false /> </autoTab>
  8097.         <lockText> <true /> </lockText>
  8098.         <rect>
  8099.             <left>14</left>
  8100.             <top>190</top>
  8101.             <right>494</right>
  8102.             <bottom>204</bottom>
  8103.         </rect>
  8104.         <style>transparent</style>
  8105.         <autoSelect> <false /> </autoSelect>
  8106.         <showLines> <false /> </showLines>
  8107.         <wideMargins> <false /> </wideMargins>
  8108.         <multipleLines> <false /> </multipleLines>
  8109.         <reservedFamily> 0 </reservedFamily>
  8110.         <titleWidth>0</titleWidth>
  8111.         <icon>0</icon>
  8112.         <textAlign>left</textAlign>
  8113.         <font>Palatino</font>
  8114.         <textSize>10</textSize>
  8115.         <textStyle>plain</textStyle>
  8116.         <textHeight>13</textHeight>
  8117.         <name></name>
  8118.         <script>on mouseUp
  8119. visual iris open
  8120. get the number of the target
  8121. get card field (it-1)
  8122. if it is not "" then
  8123. -- added following to return to card
  8124. global xrefdepth
  8125. add 1 to xrefdepth
  8126. push card
  8127. show background button "return"
  8128. go card it
  8129. end if
  8130. end mouseUp
  8131. </script>
  8132.     </part>
  8133.     <part>
  8134.         <id>54</id>
  8135.         <type>field</type>
  8136.         <visible> <true /> </visible>
  8137.         <dontWrap> <false /> </dontWrap>
  8138.         <dontSearch> <false /> </dontSearch>
  8139.         <sharedText> <false /> </sharedText>
  8140.         <fixedLineHeight> <true /> </fixedLineHeight>
  8141.         <autoTab> <false /> </autoTab>
  8142.         <lockText> <true /> </lockText>
  8143.         <rect>
  8144.             <left>451</left>
  8145.             <top>203</top>
  8146.             <right>494</right>
  8147.             <bottom>217</bottom>
  8148.         </rect>
  8149.         <style>transparent</style>
  8150.         <autoSelect> <false /> </autoSelect>
  8151.         <showLines> <false /> </showLines>
  8152.         <wideMargins> <false /> </wideMargins>
  8153.         <multipleLines> <false /> </multipleLines>
  8154.         <reservedFamily> 0 </reservedFamily>
  8155.         <titleWidth>0</titleWidth>
  8156.         <icon>0</icon>
  8157.         <textAlign>right</textAlign>
  8158.         <font>Palatino</font>
  8159.         <textSize>10</textSize>
  8160.         <textStyle>plain</textStyle>
  8161.         <textHeight>13</textHeight>
  8162.         <name></name>
  8163.         <script></script>
  8164.     </part>
  8165.     <part>
  8166.         <id>53</id>
  8167.         <type>field</type>
  8168.         <visible> <true /> </visible>
  8169.         <dontWrap> <false /> </dontWrap>
  8170.         <dontSearch> <false /> </dontSearch>
  8171.         <sharedText> <false /> </sharedText>
  8172.         <fixedLineHeight> <true /> </fixedLineHeight>
  8173.         <autoTab> <false /> </autoTab>
  8174.         <lockText> <true /> </lockText>
  8175.         <rect>
  8176.             <left>14</left>
  8177.             <top>203</top>
  8178.             <right>494</right>
  8179.             <bottom>217</bottom>
  8180.         </rect>
  8181.         <style>transparent</style>
  8182.         <autoSelect> <false /> </autoSelect>
  8183.         <showLines> <false /> </showLines>
  8184.         <wideMargins> <false /> </wideMargins>
  8185.         <multipleLines> <false /> </multipleLines>
  8186.         <reservedFamily> 0 </reservedFamily>
  8187.         <titleWidth>0</titleWidth>
  8188.         <icon>0</icon>
  8189.         <textAlign>left</textAlign>
  8190.         <font>Palatino</font>
  8191.         <textSize>10</textSize>
  8192.         <textStyle>plain</textStyle>
  8193.         <textHeight>13</textHeight>
  8194.         <name></name>
  8195.         <script>on mouseUp
  8196. visual iris open
  8197. get the number of the target
  8198. get card field (it-1)
  8199. if it is not "" then
  8200. -- added following to return to card
  8201. global xrefdepth
  8202. add 1 to xrefdepth
  8203. push card
  8204. show background button "return"
  8205. go card it
  8206. end if
  8207. end mouseUp
  8208. </script>
  8209.     </part>
  8210.     <part>
  8211.         <id>56</id>
  8212.         <type>field</type>
  8213.         <visible> <true /> </visible>
  8214.         <dontWrap> <false /> </dontWrap>
  8215.         <dontSearch> <false /> </dontSearch>
  8216.         <sharedText> <false /> </sharedText>
  8217.         <fixedLineHeight> <true /> </fixedLineHeight>
  8218.         <autoTab> <false /> </autoTab>
  8219.         <lockText> <true /> </lockText>
  8220.         <rect>
  8221.             <left>451</left>
  8222.             <top>216</top>
  8223.             <right>494</right>
  8224.             <bottom>230</bottom>
  8225.         </rect>
  8226.         <style>transparent</style>
  8227.         <autoSelect> <false /> </autoSelect>
  8228.         <showLines> <false /> </showLines>
  8229.         <wideMargins> <false /> </wideMargins>
  8230.         <multipleLines> <false /> </multipleLines>
  8231.         <reservedFamily> 0 </reservedFamily>
  8232.         <titleWidth>0</titleWidth>
  8233.         <icon>0</icon>
  8234.         <textAlign>right</textAlign>
  8235.         <font>Palatino</font>
  8236.         <textSize>10</textSize>
  8237.         <textStyle>plain</textStyle>
  8238.         <textHeight>13</textHeight>
  8239.         <name></name>
  8240.         <script></script>
  8241.     </part>
  8242.     <part>
  8243.         <id>55</id>
  8244.         <type>field</type>
  8245.         <visible> <true /> </visible>
  8246.         <dontWrap> <false /> </dontWrap>
  8247.         <dontSearch> <false /> </dontSearch>
  8248.         <sharedText> <false /> </sharedText>
  8249.         <fixedLineHeight> <true /> </fixedLineHeight>
  8250.         <autoTab> <false /> </autoTab>
  8251.         <lockText> <true /> </lockText>
  8252.         <rect>
  8253.             <left>14</left>
  8254.             <top>216</top>
  8255.             <right>494</right>
  8256.             <bottom>230</bottom>
  8257.         </rect>
  8258.         <style>transparent</style>
  8259.         <autoSelect> <false /> </autoSelect>
  8260.         <showLines> <false /> </showLines>
  8261.         <wideMargins> <false /> </wideMargins>
  8262.         <multipleLines> <false /> </multipleLines>
  8263.         <reservedFamily> 0 </reservedFamily>
  8264.         <titleWidth>0</titleWidth>
  8265.         <icon>0</icon>
  8266.         <textAlign>left</textAlign>
  8267.         <font>Palatino</font>
  8268.         <textSize>10</textSize>
  8269.         <textStyle>plain</textStyle>
  8270.         <textHeight>13</textHeight>
  8271.         <name></name>
  8272.         <script>on mouseUp
  8273. visual iris open
  8274. get the number of the target
  8275. get card field (it-1)
  8276. if it is not "" then
  8277. -- added following to return to card
  8278. global xrefdepth
  8279. add 1 to xrefdepth
  8280. push card
  8281. show background button "return"
  8282. go card it
  8283. end if
  8284. end mouseUp
  8285. </script>
  8286.     </part>
  8287.     <part>
  8288.         <id>58</id>
  8289.         <type>field</type>
  8290.         <visible> <true /> </visible>
  8291.         <dontWrap> <false /> </dontWrap>
  8292.         <dontSearch> <false /> </dontSearch>
  8293.         <sharedText> <false /> </sharedText>
  8294.         <fixedLineHeight> <true /> </fixedLineHeight>
  8295.         <autoTab> <false /> </autoTab>
  8296.         <lockText> <true /> </lockText>
  8297.         <rect>
  8298.             <left>451</left>
  8299.             <top>229</top>
  8300.             <right>494</right>
  8301.             <bottom>243</bottom>
  8302.         </rect>
  8303.         <style>transparent</style>
  8304.         <autoSelect> <false /> </autoSelect>
  8305.         <showLines> <false /> </showLines>
  8306.         <wideMargins> <false /> </wideMargins>
  8307.         <multipleLines> <false /> </multipleLines>
  8308.         <reservedFamily> 0 </reservedFamily>
  8309.         <titleWidth>0</titleWidth>
  8310.         <icon>0</icon>
  8311.         <textAlign>right</textAlign>
  8312.         <font>Palatino</font>
  8313.         <textSize>10</textSize>
  8314.         <textStyle>plain</textStyle>
  8315.         <textHeight>13</textHeight>
  8316.         <name></name>
  8317.         <script></script>
  8318.     </part>
  8319.     <part>
  8320.         <id>57</id>
  8321.         <type>field</type>
  8322.         <visible> <true /> </visible>
  8323.         <dontWrap> <false /> </dontWrap>
  8324.         <dontSearch> <false /> </dontSearch>
  8325.         <sharedText> <false /> </sharedText>
  8326.         <fixedLineHeight> <true /> </fixedLineHeight>
  8327.         <autoTab> <false /> </autoTab>
  8328.         <lockText> <true /> </lockText>
  8329.         <rect>
  8330.             <left>14</left>
  8331.             <top>229</top>
  8332.             <right>494</right>
  8333.             <bottom>243</bottom>
  8334.         </rect>
  8335.         <style>transparent</style>
  8336.         <autoSelect> <false /> </autoSelect>
  8337.         <showLines> <false /> </showLines>
  8338.         <wideMargins> <false /> </wideMargins>
  8339.         <multipleLines> <false /> </multipleLines>
  8340.         <reservedFamily> 0 </reservedFamily>
  8341.         <titleWidth>0</titleWidth>
  8342.         <icon>0</icon>
  8343.         <textAlign>left</textAlign>
  8344.         <font>Palatino</font>
  8345.         <textSize>10</textSize>
  8346.         <textStyle>plain</textStyle>
  8347.         <textHeight>13</textHeight>
  8348.         <name></name>
  8349.         <script>on mouseUp
  8350. visual iris open
  8351. get the number of the target
  8352. get card field (it-1)
  8353. if it is not "" then
  8354. -- added following to return to card
  8355. global xrefdepth
  8356. add 1 to xrefdepth
  8357. push card
  8358. show background button "return"
  8359. go card it
  8360. end if
  8361. end mouseUp
  8362. </script>
  8363.     </part>
  8364.     <part>
  8365.         <id>60</id>
  8366.         <type>field</type>
  8367.         <visible> <true /> </visible>
  8368.         <dontWrap> <false /> </dontWrap>
  8369.         <dontSearch> <false /> </dontSearch>
  8370.         <sharedText> <false /> </sharedText>
  8371.         <fixedLineHeight> <true /> </fixedLineHeight>
  8372.         <autoTab> <false /> </autoTab>
  8373.         <lockText> <true /> </lockText>
  8374.         <rect>
  8375.             <left>451</left>
  8376.             <top>242</top>
  8377.             <right>494</right>
  8378.             <bottom>255</bottom>
  8379.         </rect>
  8380.         <style>transparent</style>
  8381.         <autoSelect> <false /> </autoSelect>
  8382.         <showLines> <false /> </showLines>
  8383.         <wideMargins> <false /> </wideMargins>
  8384.         <multipleLines> <false /> </multipleLines>
  8385.         <reservedFamily> 0 </reservedFamily>
  8386.         <titleWidth>0</titleWidth>
  8387.         <icon>0</icon>
  8388.         <textAlign>right</textAlign>
  8389.         <font>Palatino</font>
  8390.         <textSize>10</textSize>
  8391.         <textStyle>plain</textStyle>
  8392.         <textHeight>13</textHeight>
  8393.         <name></name>
  8394.         <script></script>
  8395.     </part>
  8396.     <part>
  8397.         <id>59</id>
  8398.         <type>field</type>
  8399.         <visible> <true /> </visible>
  8400.         <dontWrap> <false /> </dontWrap>
  8401.         <dontSearch> <false /> </dontSearch>
  8402.         <sharedText> <false /> </sharedText>
  8403.         <fixedLineHeight> <true /> </fixedLineHeight>
  8404.         <autoTab> <false /> </autoTab>
  8405.         <lockText> <true /> </lockText>
  8406.         <rect>
  8407.             <left>14</left>
  8408.             <top>242</top>
  8409.             <right>494</right>
  8410.             <bottom>256</bottom>
  8411.         </rect>
  8412.         <style>transparent</style>
  8413.         <autoSelect> <false /> </autoSelect>
  8414.         <showLines> <false /> </showLines>
  8415.         <wideMargins> <false /> </wideMargins>
  8416.         <multipleLines> <false /> </multipleLines>
  8417.         <reservedFamily> 0 </reservedFamily>
  8418.         <titleWidth>0</titleWidth>
  8419.         <icon>0</icon>
  8420.         <textAlign>left</textAlign>
  8421.         <font>Palatino</font>
  8422.         <textSize>10</textSize>
  8423.         <textStyle>plain</textStyle>
  8424.         <textHeight>13</textHeight>
  8425.         <name></name>
  8426.         <script>on mouseUp
  8427. visual iris open
  8428. get the number of the target
  8429. get card field (it-1)
  8430. if it is not "" then
  8431. -- added following to return to card
  8432. global xrefdepth
  8433. add 1 to xrefdepth
  8434. push card
  8435. show background button "return"
  8436. go card it
  8437. end if
  8438. end mouseUp
  8439. </script>
  8440.     </part>
  8441.     <part>
  8442.         <id>62</id>
  8443.         <type>field</type>
  8444.         <visible> <true /> </visible>
  8445.         <dontWrap> <false /> </dontWrap>
  8446.         <dontSearch> <false /> </dontSearch>
  8447.         <sharedText> <false /> </sharedText>
  8448.         <fixedLineHeight> <true /> </fixedLineHeight>
  8449.         <autoTab> <false /> </autoTab>
  8450.         <lockText> <true /> </lockText>
  8451.         <rect>
  8452.             <left>451</left>
  8453.             <top>255</top>
  8454.             <right>494</right>
  8455.             <bottom>268</bottom>
  8456.         </rect>
  8457.         <style>transparent</style>
  8458.         <autoSelect> <false /> </autoSelect>
  8459.         <showLines> <false /> </showLines>
  8460.         <wideMargins> <false /> </wideMargins>
  8461.         <multipleLines> <false /> </multipleLines>
  8462.         <reservedFamily> 0 </reservedFamily>
  8463.         <titleWidth>0</titleWidth>
  8464.         <icon>0</icon>
  8465.         <textAlign>right</textAlign>
  8466.         <font>Palatino</font>
  8467.         <textSize>10</textSize>
  8468.         <textStyle>plain</textStyle>
  8469.         <textHeight>13</textHeight>
  8470.         <name></name>
  8471.         <script></script>
  8472.     </part>
  8473.     <part>
  8474.         <id>61</id>
  8475.         <type>field</type>
  8476.         <visible> <true /> </visible>
  8477.         <dontWrap> <false /> </dontWrap>
  8478.         <dontSearch> <false /> </dontSearch>
  8479.         <sharedText> <false /> </sharedText>
  8480.         <fixedLineHeight> <true /> </fixedLineHeight>
  8481.         <autoTab> <false /> </autoTab>
  8482.         <lockText> <true /> </lockText>
  8483.         <rect>
  8484.             <left>14</left>
  8485.             <top>255</top>
  8486.             <right>494</right>
  8487.             <bottom>269</bottom>
  8488.         </rect>
  8489.         <style>transparent</style>
  8490.         <autoSelect> <false /> </autoSelect>
  8491.         <showLines> <false /> </showLines>
  8492.         <wideMargins> <false /> </wideMargins>
  8493.         <multipleLines> <false /> </multipleLines>
  8494.         <reservedFamily> 0 </reservedFamily>
  8495.         <titleWidth>0</titleWidth>
  8496.         <icon>0</icon>
  8497.         <textAlign>left</textAlign>
  8498.         <font>Palatino</font>
  8499.         <textSize>10</textSize>
  8500.         <textStyle>plain</textStyle>
  8501.         <textHeight>13</textHeight>
  8502.         <name></name>
  8503.         <script>on mouseUp
  8504. visual iris open
  8505. get the number of the target
  8506. get card field (it-1)
  8507. if it is not "" then
  8508. -- added following to return to card
  8509. global xrefdepth
  8510. add 1 to xrefdepth
  8511. push card
  8512. show background button "return"
  8513. go card it
  8514. end if
  8515. end mouseUp
  8516. </script>
  8517.     </part>
  8518.     <part>
  8519.         <id>64</id>
  8520.         <type>field</type>
  8521.         <visible> <true /> </visible>
  8522.         <dontWrap> <false /> </dontWrap>
  8523.         <dontSearch> <false /> </dontSearch>
  8524.         <sharedText> <false /> </sharedText>
  8525.         <fixedLineHeight> <true /> </fixedLineHeight>
  8526.         <autoTab> <false /> </autoTab>
  8527.         <lockText> <true /> </lockText>
  8528.         <rect>
  8529.             <left>451</left>
  8530.             <top>268</top>
  8531.             <right>494</right>
  8532.             <bottom>282</bottom>
  8533.         </rect>
  8534.         <style>transparent</style>
  8535.         <autoSelect> <false /> </autoSelect>
  8536.         <showLines> <false /> </showLines>
  8537.         <wideMargins> <false /> </wideMargins>
  8538.         <multipleLines> <false /> </multipleLines>
  8539.         <reservedFamily> 0 </reservedFamily>
  8540.         <titleWidth>0</titleWidth>
  8541.         <icon>0</icon>
  8542.         <textAlign>right</textAlign>
  8543.         <font>Palatino</font>
  8544.         <textSize>10</textSize>
  8545.         <textStyle>plain</textStyle>
  8546.         <textHeight>13</textHeight>
  8547.         <name></name>
  8548.         <script></script>
  8549.     </part>
  8550.     <part>
  8551.         <id>63</id>
  8552.         <type>field</type>
  8553.         <visible> <true /> </visible>
  8554.         <dontWrap> <false /> </dontWrap>
  8555.         <dontSearch> <false /> </dontSearch>
  8556.         <sharedText> <false /> </sharedText>
  8557.         <fixedLineHeight> <true /> </fixedLineHeight>
  8558.         <autoTab> <false /> </autoTab>
  8559.         <lockText> <true /> </lockText>
  8560.         <rect>
  8561.             <left>14</left>
  8562.             <top>268</top>
  8563.             <right>494</right>
  8564.             <bottom>282</bottom>
  8565.         </rect>
  8566.         <style>transparent</style>
  8567.         <autoSelect> <false /> </autoSelect>
  8568.         <showLines> <false /> </showLines>
  8569.         <wideMargins> <false /> </wideMargins>
  8570.         <multipleLines> <false /> </multipleLines>
  8571.         <reservedFamily> 0 </reservedFamily>
  8572.         <titleWidth>0</titleWidth>
  8573.         <icon>0</icon>
  8574.         <textAlign>left</textAlign>
  8575.         <font>Palatino</font>
  8576.         <textSize>10</textSize>
  8577.         <textStyle>plain</textStyle>
  8578.         <textHeight>13</textHeight>
  8579.         <name></name>
  8580.         <script>on mouseUp
  8581. visual iris open
  8582. get the number of the target
  8583. get card field (it-1)
  8584. if it is not "" then
  8585. -- added following to return to card
  8586. global xrefdepth
  8587. add 1 to xrefdepth
  8588. push card
  8589. show background button "return"
  8590. go card it
  8591. end if
  8592. end mouseUp
  8593. </script>
  8594.     </part>
  8595.     <part>
  8596.         <id>66</id>
  8597.         <type>field</type>
  8598.         <visible> <true /> </visible>
  8599.         <dontWrap> <false /> </dontWrap>
  8600.         <dontSearch> <false /> </dontSearch>
  8601.         <sharedText> <false /> </sharedText>
  8602.         <fixedLineHeight> <true /> </fixedLineHeight>
  8603.         <autoTab> <false /> </autoTab>
  8604.         <lockText> <true /> </lockText>
  8605.         <rect>
  8606.             <left>451</left>
  8607.             <top>281</top>
  8608.             <right>494</right>
  8609.             <bottom>295</bottom>
  8610.         </rect>
  8611.         <style>transparent</style>
  8612.         <autoSelect> <false /> </autoSelect>
  8613.         <showLines> <false /> </showLines>
  8614.         <wideMargins> <false /> </wideMargins>
  8615.         <multipleLines> <false /> </multipleLines>
  8616.         <reservedFamily> 0 </reservedFamily>
  8617.         <titleWidth>0</titleWidth>
  8618.         <icon>0</icon>
  8619.         <textAlign>right</textAlign>
  8620.         <font>Palatino</font>
  8621.         <textSize>10</textSize>
  8622.         <textStyle>plain</textStyle>
  8623.         <textHeight>13</textHeight>
  8624.         <name></name>
  8625.         <script></script>
  8626.     </part>
  8627.     <part>
  8628.         <id>65</id>
  8629.         <type>field</type>
  8630.         <visible> <true /> </visible>
  8631.         <dontWrap> <false /> </dontWrap>
  8632.         <dontSearch> <false /> </dontSearch>
  8633.         <sharedText> <false /> </sharedText>
  8634.         <fixedLineHeight> <true /> </fixedLineHeight>
  8635.         <autoTab> <false /> </autoTab>
  8636.         <lockText> <true /> </lockText>
  8637.         <rect>
  8638.             <left>14</left>
  8639.             <top>281</top>
  8640.             <right>494</right>
  8641.             <bottom>295</bottom>
  8642.         </rect>
  8643.         <style>transparent</style>
  8644.         <autoSelect> <false /> </autoSelect>
  8645.         <showLines> <false /> </showLines>
  8646.         <wideMargins> <false /> </wideMargins>
  8647.         <multipleLines> <false /> </multipleLines>
  8648.         <reservedFamily> 0 </reservedFamily>
  8649.         <titleWidth>0</titleWidth>
  8650.         <icon>0</icon>
  8651.         <textAlign>left</textAlign>
  8652.         <font>Palatino</font>
  8653.         <textSize>10</textSize>
  8654.         <textStyle>plain</textStyle>
  8655.         <textHeight>13</textHeight>
  8656.         <name></name>
  8657.         <script>on mouseUp
  8658. visual iris open
  8659. get the number of the target
  8660. get card field (it-1)
  8661. if it is not "" then
  8662. -- added following to return to card
  8663. global xrefdepth
  8664. add 1 to xrefdepth
  8665. push card
  8666. show background button "return"
  8667. go card it
  8668. end if
  8669. end mouseUp
  8670. </script>
  8671.     </part>
  8672.     <part>
  8673.         <id>130</id>
  8674.         <type>button</type>
  8675.         <visible> <false /> </visible>
  8676.         <reserved5> 0 </reserved5>
  8677.         <reserved4> 0 </reserved4>
  8678.         <reserved3> 0 </reserved3>
  8679.         <reserved2> 0 </reserved2>
  8680.         <reserved1> 0 </reserved1>
  8681.         <enabled> <true /> </enabled>
  8682.         <rect>
  8683.             <left>352</left>
  8684.             <top>26</top>
  8685.             <right>475</right>
  8686.             <bottom>43</bottom>
  8687.         </rect>
  8688.         <style>roundrect</style>
  8689.         <showName> <true /> </showName>
  8690.         <highlight> <false /> </highlight>
  8691.         <autoHighlight> <true /> </autoHighlight>
  8692.         <sharedHighlight> <true /> </sharedHighlight>
  8693.         <family>0</family>
  8694.         <titleWidth>0</titleWidth>
  8695.         <icon>0</icon>
  8696.         <textAlign>center</textAlign>
  8697.         <font>Chicago</font>
  8698.         <textSize>12</textSize>
  8699.         <textStyle>plain</textStyle>
  8700.         <name>Add Contents Pg.</name>
  8701.         <script>on mouseUp
  8702. put the userLevel into currentLevel
  8703. set the userLevel to 5
  8704. doMenu "Copy Card"
  8705. doMenu "Paste Card"
  8706. put "" into field "page no"
  8707. send updateContents to this card
  8708. set the userLevel to currentLevel
  8709. end mouseUp
  8710. </script>
  8711.     </part>
  8712.     <content>
  8713.         <layer>card</layer>
  8714.         <id>14</id>
  8715.         <text>card id 4342</text>
  8716.     </content>
  8717.     <content>
  8718.         <layer>background</layer>
  8719.         <id>4</id>
  8720.         <text>
  8721.  
  8722.  
  8723.  
  8724.  
  8725.  
  8726.  
  8727.  
  8728. </text>
  8729.     </content>
  8730.     <content>
  8731.         <layer>card</layer>
  8732.         <id>24</id>
  8733.         <text>0</text>
  8734.     </content>
  8735.     <content>
  8736.         <layer>card</layer>
  8737.         <id>25</id>
  8738.         <text>0</text>
  8739.     </content>
  8740.     <content>
  8741.         <layer>background</layer>
  8742.         <id>6</id>
  8743.         <text>List of Code Examples</text>
  8744.     </content>
  8745.     <content>
  8746.         <layer>background</layer>
  8747.         <id>7</id>
  8748.         <text>4</text>
  8749.     </content>
  8750.     <content>
  8751.         <layer>card</layer>
  8752.         <id>20</id>
  8753.         <text>(click on the topic or page no. of interest)</text>
  8754.     </content>
  8755.     <content>
  8756.         <layer>card</layer>
  8757.         <id>31</id>
  8758.         <text>19</text>
  8759.     </content>
  8760.     <content>
  8761.         <layer>card</layer>
  8762.         <id>30</id>
  8763.         <text>Simple Person class example</text>
  8764.     </content>
  8765.     <content>
  8766.         <layer>card</layer>
  8767.         <id>35</id>
  8768.         <text>43</text>
  8769.     </content>
  8770.     <content>
  8771.         <layer>card</layer>
  8772.         <id>34</id>
  8773.         <text>Derivation of Student class from Person class</text>
  8774.     </content>
  8775.     <content>
  8776.         <layer>card</layer>
  8777.         <id>39</id>
  8778.         <text>92</text>
  8779.     </content>
  8780.     <content>
  8781.         <layer>card</layer>
  8782.         <id>38</id>
  8783.         <text>Example of user-defined data types</text>
  8784.     </content>
  8785.     <content>
  8786.         <layer>card</layer>
  8787.         <id>46</id>
  8788.         <text>113</text>
  8789.     </content>
  8790.     <content>
  8791.         <layer>card</layer>
  8792.         <id>45</id>
  8793.         <text>Example of recursion, multiple source files</text>
  8794.     </content>
  8795.     <content>
  8796.         <layer>card</layer>
  8797.         <id>50</id>
  8798.         <text>145</text>
  8799.     </content>
  8800.     <content>
  8801.         <layer>card</layer>
  8802.         <id>49</id>
  8803.         <text>Object-oriented program using multiple source and header files</text>
  8804.     </content>
  8805.     <content>
  8806.         <layer>card</layer>
  8807.         <id>54</id>
  8808.         <text>229</text>
  8809.     </content>
  8810.     <content>
  8811.         <layer>card</layer>
  8812.         <id>53</id>
  8813.         <text>Portable 2-D graphics</text>
  8814.     </content>
  8815.     <content>
  8816.         <layer>card</layer>
  8817.         <id>58</id>
  8818.         <text>240</text>
  8819.     </content>
  8820.     <content>
  8821.         <layer>card</layer>
  8822.         <id>57</id>
  8823.         <text>Application framework, database example</text>
  8824.     </content>
  8825.     <name>contents (cont)</name>
  8826.     <script>-- modified version for only 18 hot fields
  8827. on updateContents
  8828. global deletedCard
  8829. put 36*((the number of me)-(the number of card "contents")) into base
  8830. set cursor to watch
  8831. put 4 into firstField
  8832. repeat with x = 1 to 18
  8833. get line x+base of card field "content list" of card "contents"
  8834. if it is word 3 of deletedCard then
  8835. put "" into line x+base of card field "content list" of card "contents"
  8836. get ""
  8837. end if
  8838. if it is "" then
  8839. put "" into card field (2*x+firstField) of card (the number of me)
  8840. put "" into card field (2*x-1+firstField) of card (the number of me)
  8841. else
  8842. put the number of card id it into card field (2*x-1+firstField)¬¨
  8843. of card (the number of me)
  8844. put it into card field (2*x+firstField) of card (the number of me)
  8845. get field "heading" of card id it
  8846. put it into word 1 of card field (2*x+firstField)¬¨
  8847. of card (the number of me)
  8848. end if
  8849. end repeat
  8850. put (the number of me) + 1 into nextCard
  8851. get the name of card nextCard
  8852. get word 2 of it
  8853. get char 2 to 9 of it
  8854. if it is "contents" then
  8855. send updateContents to card nextCard
  8856. end if
  8857. end updateContents
  8858.  
  8859. </script>
  8860. </card>
  8861.  
  8862.  
  8863. card_3971.xml
  8864. <?xml version="1.0" encoding="utf-8" ?>
  8865. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  8866. <card>
  8867.     <id>3971</id>
  8868.     <filler1>0</filler1>
  8869.     <cantDelete> <false /> </cantDelete>
  8870.     <showPict> <true /> </showPict>
  8871.     <dontSearch> <false /> </dontSearch>
  8872.     <owner>4755</owner>
  8873.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  8874.     <content>
  8875.         <layer>background</layer>
  8876.         <id>4</id>
  8877.         <text><span class="style3">he C programming language has grown popular due to its simplicity, efficiency, and flexibility.  C programs are often easily adapted to new environments.  The recent ANSI C standard extends, standardizes, and makes consistent traditional C.
  8878.  
  8879. Symantec Corporation's* Think C 5.0 (henceforth called TC) includes an extension of ANSI C to support object-oriented programming (OOP) techniques.  TC programs are organized according to the data structures of interest in the chosen application.  Each data structure is encapsulated with the procedures acting upon the data to form an </span><span class="style7">object</span><span class="style3">.  The features of inheritance (features of objects are easily "derived from" those of existing objects) and polymorphism (the procedures belonging to related objects may have the same names) are supported in TC.  This organization promotes code reusability and maintainability, and allows great model consistency from the analysis through the implementation phases of the software engineering effort. 
  8880.  
  8881. In contrast, conventional C programs are usually organized according to a procedural decomposition.  A measure of object-orientation can be achieved in well-structured C programs by defining each data structure and the procedures which act upon it in </span></text>
  8882.     </content>
  8883.     <content>
  8884.         <layer>background</layer>
  8885.         <id>6</id>
  8886.         <text>Preface</text>
  8887.     </content>
  8888.     <content>
  8889.         <layer>background</layer>
  8890.         <id>7</id>
  8891.         <text>5</text>
  8892.     </content>
  8893.     <content>
  8894.         <layer>background</layer>
  8895.         <id>27</id>
  8896.         <text>Symantec Corp.
  8897. </text>
  8898.     </content>
  8899.     <content>
  8900.         <layer>background</layer>
  8901.         <id>29</id>
  8902.         <text>10231
  8903. </text>
  8904.     </content>
  8905.     <content>
  8906.         <layer>background</layer>
  8907.         <id>20</id>
  8908.         <text>Symantec Corp. - p13</text>
  8909.     </content>
  8910.     <name>preface</name>
  8911.     <script></script>
  8912. </card>
  8913.  
  8914.  
  8915. card_9608.xml
  8916. <?xml version="1.0" encoding="utf-8" ?>
  8917. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  8918. <card>
  8919.     <id>9608</id>
  8920.     <filler1>0</filler1>
  8921.     <cantDelete> <false /> </cantDelete>
  8922.     <showPict> <true /> </showPict>
  8923.     <dontSearch> <false /> </dontSearch>
  8924.     <owner>4755</owner>
  8925.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  8926.     <content>
  8927.         <layer>background</layer>
  8928.         <id>4</id>
  8929.         <text>an individual source file, using "static external" storage.  However, the useful inheritance and polymorphism features cannot easily and consistently be duplicated.
  8930.  
  8931. The C++ language is a more detailed extension of C to further support modern structured programming techniques.  In effect, TC is between ANSI C and C++.  After learning TC the programmer can begin using C++ with little difficulty, and can learn the powerful added features of C++ at a later date if necessary.  Note that by facilitating OOP, TC often allows simpler code than that produced using ANSI C.  On the other hand some programmers find that the additional features provided by C++ add significant complexity to the elegant C language.
  8932.  
  8933. While TC is a unique language, the compatibility with ANSI C and the upward-compatibility with C++ lend TC programs the potential for a high degree of portability.  If the Think Class Library is used to produce Macintosh-only applications, a measure of portability may be retained by careful characterization and isolation of the non-portable objects.*
  8934.  
  8935.  
  8936. </text>
  8937.     </content>
  8938.     <content>
  8939.         <layer>background</layer>
  8940.         <id>7</id>
  8941.         <text>6</text>
  8942.     </content>
  8943.     <content>
  8944.         <layer>background</layer>
  8945.         <id>29</id>
  8946.         <text>62767</text>
  8947.     </content>
  8948.     <content>
  8949.         <layer>background</layer>
  8950.         <id>27</id>
  8951.         <text>Portability via class libraries</text>
  8952.     </content>
  8953.     <content>
  8954.         <layer>background</layer>
  8955.         <id>20</id>
  8956.         <text>Portability via class libraries - p234</text>
  8957.     </content>
  8958.     <name></name>
  8959.     <script></script>
  8960. </card>
  8961.  
  8962.  
  8963. card_42626.xml
  8964. <?xml version="1.0" encoding="utf-8" ?>
  8965. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  8966. <card>
  8967.     <id>42626</id>
  8968.     <filler1>0</filler1>
  8969.     <cantDelete> <false /> </cantDelete>
  8970.     <showPict> <true /> </showPict>
  8971.     <dontSearch> <false /> </dontSearch>
  8972.     <owner>4755</owner>
  8973.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  8974.     <content>
  8975.         <layer>background</layer>
  8976.         <id>4</id>
  8977.         <text>Most importantly, the Think C environment ‚Äî with integrated editor, debugger, and class browser ‚Äî is a powerful, productive, yet forgiving tool for software development on Macintosh computers.  It is popular with both novice and professional programmers.
  8978.  
  8979.  
  8980. </text>
  8981.     </content>
  8982.     <content>
  8983.         <layer>background</layer>
  8984.         <id>7</id>
  8985.         <text>7</text>
  8986.     </content>
  8987.     <name></name>
  8988.     <script></script>
  8989. </card>
  8990.  
  8991.  
  8992. card_10457.xml
  8993. <?xml version="1.0" encoding="utf-8" ?>
  8994. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  8995. <card>
  8996.     <id>10457</id>
  8997.     <filler1>0</filler1>
  8998.     <cantDelete> <false /> </cantDelete>
  8999.     <showPict> <true /> </showPict>
  9000.     <dontSearch> <false /> </dontSearch>
  9001.     <owner>4755</owner>
  9002.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9003.     <content>
  9004.         <layer>background</layer>
  9005.         <id>4</id>
  9006.         <text>SCOPE
  9007.  
  9008. This document may be used to supplement an undergraduate course on Object-Oriented Programming techniques or C++.  It differs from other textbooks by introducing TC/C++ for persons with no C programming experience, stressing OOP techniques and the most-used features of C.  Persons with C background should study Ch. 1, 2.5, 3.1, 4, 7.2, 9, and Appendix 2.
  9009.  
  9010. Persons with no previous C experience may wish to supplement this material with a more extensive tutorial-style C text such as Lawrence Miller and Alexander Quilici's "Programming in C" (Wiley).*  An excellent alternative for beginning programmers is Dave Mark's disk-based "Learn C on the Macintosh" (Addison-Wesley).*
  9011.  
  9012. The approach taken is practical and informal.  Therefore, it is recommended that the reader supplement this material with a detailed reference of the ANSI-standard C language, such as the newest edition of Brian Kernighan and Dennis Ritchie's "The C Programming Language" (Prentice-Hall)*, as well as the TC manuals.
  9013.  
  9014. </text>
  9015.     </content>
  9016.     <content>
  9017.         <layer>background</layer>
  9018.         <id>27</id>
  9019.         <text>Bibliography</text>
  9020.     </content>
  9021.     <content>
  9022.         <layer>background</layer>
  9023.         <id>20</id>
  9024.         <text>Bibliography - p259</text>
  9025.     </content>
  9026.     <content>
  9027.         <layer>background</layer>
  9028.         <id>7</id>
  9029.         <text>8</text>
  9030.     </content>
  9031.     <content>
  9032.         <layer>background</layer>
  9033.         <id>29</id>
  9034.         <text>2231</text>
  9035.     </content>
  9036.     <name></name>
  9037.     <script></script>
  9038. </card>
  9039.  
  9040.  
  9041. card_10514.xml
  9042. <?xml version="1.0" encoding="utf-8" ?>
  9043. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9044. <card>
  9045.     <id>10514</id>
  9046.     <filler1>0</filler1>
  9047.     <cantDelete> <false /> </cantDelete>
  9048.     <showPict> <true /> </showPict>
  9049.     <dontSearch> <false /> </dontSearch>
  9050.     <owner>4755</owner>
  9051.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9052.     <content>
  9053.         <layer>background</layer>
  9054.         <id>4</id>
  9055.         <text>Concepts of object-oriented programming are introduced here in the context of TC.  An excellent text detailing OO concepts and their use is Grady Booch's "Object-Oriented Design" (Benjamin-Cummings).*  Other resources include Peter Coad and Edward Yourdon's "Object-Oriented Analysis" (Prentice-Hall)* and Bertrand Meyer's "Object-Oriented Software Construction" (Prentice-Hall).*  A reference-style source of features specific to C++ is Bjarne Stroustrup's "The C++ Programming Language" (Addison-Wesley).*
  9056.  
  9057. This document is not intended as a source for Macintosh programming techniques.  That is, there is little discussion on the Macintosh Toolbox ROM routines nor on the event-oriented user-interaction model.  An invaluable introduction to these issues is David Mark and Cartwright Reed's "Macintosh Programming Primer" (Addison- Wesley).*
  9058.  
  9059. Finally, the issue of using existing class libraries to simplify application design is discussed only in a simplified setting, with little regard for the Think Class Library provided with Think C.  The reader should investigate the discussion in the Think
  9060.  
  9061. </text>
  9062.     </content>
  9063.     <content>
  9064.         <layer>background</layer>
  9065.         <id>7</id>
  9066.         <text>9</text>
  9067.     </content>
  9068.     <content>
  9069.         <layer>background</layer>
  9070.         <id>29</id>
  9071.         <text>2231</text>
  9072.     </content>
  9073.     <content>
  9074.         <layer>background</layer>
  9075.         <id>27</id>
  9076.         <text>Bibliography</text>
  9077.     </content>
  9078.     <content>
  9079.         <layer>background</layer>
  9080.         <id>20</id>
  9081.         <text>Bibliography - p259</text>
  9082.     </content>
  9083.     <name></name>
  9084.     <script></script>
  9085. </card>
  9086.  
  9087.  
  9088. card_48838.xml
  9089. <?xml version="1.0" encoding="utf-8" ?>
  9090. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9091. <card>
  9092.     <id>48838</id>
  9093.     <filler1>0</filler1>
  9094.     <cantDelete> <false /> </cantDelete>
  9095.     <showPict> <true /> </showPict>
  9096.     <dontSearch> <false /> </dontSearch>
  9097.     <owner>4755</owner>
  9098.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9099.     <content>
  9100.         <layer>background</layer>
  9101.         <id>4</id>
  9102.         <text>C manuals before attempting to develop professional-quality Macintosh software.
  9103.  
  9104. </text>
  9105.     </content>
  9106.     <content>
  9107.         <layer>background</layer>
  9108.         <id>7</id>
  9109.         <text>10</text>
  9110.     </content>
  9111.     <name></name>
  9112.     <script></script>
  9113. </card>
  9114.  
  9115.  
  9116. card_11909.xml
  9117. <?xml version="1.0" encoding="utf-8" ?>
  9118. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9119. <card>
  9120.     <id>11909</id>
  9121.     <filler1>0</filler1>
  9122.     <cantDelete> <false /> </cantDelete>
  9123.     <showPict> <true /> </showPict>
  9124.     <dontSearch> <false /> </dontSearch>
  9125.     <owner>4755</owner>
  9126.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9127.     <content>
  9128.         <layer>background</layer>
  9129.         <id>4</id>
  9130.         <text><span class="style3">RGANIZATION
  9131.  
  9132. A HyperCard interface was chosen for this document because of the ease with which information may be cross-referenced, its ease of distribution, and because of the ability to provide source code in ready-to-use media.  The use of footnotes for crossreferencing allows hardcopies of this HyperCard stack to retain all the information of the electronic version, with the exception of  program listings given in scrolling text fields.
  9133.  
  9134. The text uses the Palatino 12 font, except for C code which is distinguished with Monaco 9.</span><span class="style4"> (This is Monaco 9.)</span><span class="style3">
  9135.  
  9136. Throughout the text an attempt will be made to indicate where ANSI C, Think C, and C++ differ.  Statements made about C usually apply to TC and C++ as well, while statements about TC usually apply to C++.  These relationships are summarized in Appendix 2.  Appendix 1 briefly describes the TC development environment.
  9137.  
  9138. </span></text>
  9139.     </content>
  9140.     <content>
  9141.         <layer>background</layer>
  9142.         <id>7</id>
  9143.         <text>11</text>
  9144.     </content>
  9145.     <name></name>
  9146.     <script></script>
  9147. </card>
  9148.  
  9149.  
  9150. card_62122.xml
  9151. <?xml version="1.0" encoding="utf-8" ?>
  9152. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9153. <card>
  9154.     <id>62122</id>
  9155.     <filler1>0</filler1>
  9156.     <cantDelete> <false /> </cantDelete>
  9157.     <showPict> <true /> </showPict>
  9158.     <dontSearch> <false /> </dontSearch>
  9159.     <owner>4755</owner>
  9160.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9161.     <content>
  9162.         <layer>background</layer>
  9163.         <id>4</id>
  9164.         <text>Chapter 1 introduces Think C and object-oriented programming with several preliminary definitions, a sample program showing the TC syntax, and a more detailed example showing the merits of the OOP approach.
  9165.  
  9166. Chapters 2 and 3 discuss C data types and functions, including sample programs.  
  9167.  
  9168. Chapter 4 shows how these concepts are combined to construct TC/C++ classes, and includes a sample program.
  9169.  
  9170. Chapters 5, 6, 7, and 8 provide an overview of C operators, statements, preprocessor directives, and standard functions.
  9171.  
  9172. Chapter 9 suggests programming techniques which take advantage of TC/C++ constructs for improved maintainability and portability.  This chapter contains code for producing simple graphics on Macintosh computers, with the potential for portability.  It also includes a text-based application framework as a simplified example of sophisticated application frameworks such as the Think Class Library.
  9173.  
  9174.  
  9175. </text>
  9176.     </content>
  9177.     <content>
  9178.         <layer>background</layer>
  9179.         <id>7</id>
  9180.         <text>12</text>
  9181.     </content>
  9182.     <name></name>
  9183.     <script></script>
  9184. </card>
  9185.  
  9186.  
  9187. card_10231.xml
  9188. <?xml version="1.0" encoding="utf-8" ?>
  9189. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9190. <card>
  9191.     <id>10231</id>
  9192.     <filler1>0</filler1>
  9193.     <cantDelete> <false /> </cantDelete>
  9194.     <showPict> <true /> </showPict>
  9195.     <dontSearch> <false /> </dontSearch>
  9196.     <owner>4755</owner>
  9197.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9198.     <content>
  9199.         <layer>background</layer>
  9200.         <id>4</id>
  9201.         <text>LANGUAGE CREDITS
  9202.  
  9203. C was originally developed (in conjunction with the UNIX operating system) at AT&T Bell Laboratories in New Jersey in the late 1960's by Dennis Ritchie.
  9204.  
  9205. C++ was developed primarily by Bjarne Stroustrup at AT&T Bell Laboratories in the early 1980's.
  9206.  
  9207. Think C v. 5.0 and the Think Class Library are Macintosh-specific products of Symantec Corporation, 10201 Torre Avenue, Cupertino, CA 95014.
  9208. </text>
  9209.     </content>
  9210.     <content>
  9211.         <layer>background</layer>
  9212.         <id>7</id>
  9213.         <text>13</text>
  9214.     </content>
  9215.     <name></name>
  9216.     <script></script>
  9217. </card>
  9218.  
  9219.  
  9220. card_19990.xml
  9221. <?xml version="1.0" encoding="utf-8" ?>
  9222. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9223. <card>
  9224.     <id>19990</id>
  9225.     <filler1>0</filler1>
  9226.     <cantDelete> <false /> </cantDelete>
  9227.     <showPict> <true /> </showPict>
  9228.     <dontSearch> <false /> </dontSearch>
  9229.     <owner>4755</owner>
  9230.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9231.     <content>
  9232.         <layer>background</layer>
  9233.         <id>4</id>
  9234.         <text>ACKNOWLEDGEMENTS
  9235.  
  9236. Sources consulted for this document included Brian Kernighan and Dennis Ritchie's "The C Programming Language" (Prentice-Hall), James Gardner's "From C to C: An Introduction to ANSI Standard C" (HBJ), Bjarne Stroustrup's "The C++ Programming Language" (Addison-Wesley), and the Think C 5.0 manuals.
  9237.  
  9238. Thanks to Dan Shafer for a practical and painless introduction to HyperTalk scripting.
  9239.  
  9240. Thanks to Maureen for everything.</text>
  9241.     </content>
  9242.     <content>
  9243.         <layer>background</layer>
  9244.         <id>7</id>
  9245.         <text>14</text>
  9246.     </content>
  9247.     <name></name>
  9248.     <script></script>
  9249. </card>
  9250.  
  9251.  
  9252. card_7205.xml
  9253. <?xml version="1.0" encoding="utf-8" ?>
  9254. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9255. <card>
  9256.     <id>7205</id>
  9257.     <filler1>0</filler1>
  9258.     <cantDelete> <false /> </cantDelete>
  9259.     <showPict> <true /> </showPict>
  9260.     <dontSearch> <false /> </dontSearch>
  9261.     <owner>4755</owner>
  9262.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9263.     <content>
  9264.         <layer>background</layer>
  9265.         <id>7</id>
  9266.         <text>15</text>
  9267.     </content>
  9268.     <content>
  9269.         <layer>background</layer>
  9270.         <id>6</id>
  9271.         <text>1.  Introduction</text>
  9272.     </content>
  9273.     <content>
  9274.         <layer>background</layer>
  9275.         <id>4</id>
  9276.         <text><span class="style3">hink C 5.0 (TC) is an extension of the C programming language to support object-oriented programming (OOP).  It is compatible with C++, which carries this extension further.  This chapter provides sample TC/C++ programs which em- phasize the OOP approach.  We will first define a few OOP terms and their use in TC.
  9277.  
  9278. An</span><span class="style6"> </span><span class="style7">object</span><span class="style3"> is a data structure combined ‚Äî or </span><span class="style7">encapsulated</span><span class="style3"> ‚Äî with the procedures which will act upon this data.  The organization of this object is the object's </span><span class="style7">class</span><span class="style3">, or the type of the object.  That is, a class definition lists the </span><span class="style7">instance variables</span><span class="style3"> (data) which are contained in all objects of this type, as well as the </span><span class="style7">methods</span><span class="style3"> (procedures), acting upon the data.  In TC/C++, the definition for the </span><span class="style4">Person</span><span class="style3"> class may look like:
  9279.  
  9280. </span><span class="style4">    struct Person
  9281.     {
  9282.         int age;
  9283.         int weight;
  9284.         set();
  9285.         print();
  9286.     };</span></text>
  9287.     </content>
  9288.     <name></name>
  9289.     <script></script>
  9290. </card>
  9291.  
  9292.  
  9293. card_10832.xml
  9294. <?xml version="1.0" encoding="utf-8" ?>
  9295. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9296. <card>
  9297.     <id>10832</id>
  9298.     <filler1>0</filler1>
  9299.     <cantDelete> <false /> </cantDelete>
  9300.     <showPict> <true /> </showPict>
  9301.     <dontSearch> <false /> </dontSearch>
  9302.     <owner>4755</owner>
  9303.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9304.     <content>
  9305.         <layer>background</layer>
  9306.         <id>4</id>
  9307.         <text><span class="style3">ny object which is defined with class </span><span class="style4">Person</span><span class="style3"> will contain integer instance variables representing age and weight.  The only procedures which act on this data are: setting the values and printing the values.  These methods may be defined by:
  9308.  
  9309. </span><span class="style4">    Person::set()
  9310.     {
  9311.         age = 28;
  9312.         weight = 150;
  9313.     }
  9314.  
  9315.     Person::print()
  9316.     {
  9317.         printf("%d ",age);
  9318.         printf("%d",weight);
  9319.     }
  9320. </span><span class="style3">
  9321. (</span><span class="style4">printf()</span><span class="style3">  is a standard C library function discussed in the next section.)
  9322. </span></text>
  9323.     </content>
  9324.     <content>
  9325.         <layer>background</layer>
  9326.         <id>7</id>
  9327.         <text>16</text>
  9328.     </content>
  9329.     <name></name>
  9330.     <script></script>
  9331. </card>
  9332.  
  9333.  
  9334. card_11123.xml
  9335. <?xml version="1.0" encoding="utf-8" ?>
  9336. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9337. <card>
  9338.     <id>11123</id>
  9339.     <filler1>0</filler1>
  9340.     <cantDelete> <false /> </cantDelete>
  9341.     <showPict> <true /> </showPict>
  9342.     <dontSearch> <false /> </dontSearch>
  9343.     <owner>4755</owner>
  9344.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9345.     <content>
  9346.         <layer>background</layer>
  9347.         <id>4</id>
  9348.         <text><span class="style3">o declare and allocate space for a </span><span class="style4">Person</span><span class="style3">-type object named </span><span class="style4">ralph</span><span class="style3">, we would write:
  9349.  
  9350. </span><span class="style4">    Person *ralph;
  9351.     ralph = new(Person);
  9352. </span><span class="style3">
  9353. The first line defines a variable named </span><span class="style4">ralph</span><span class="style3"> which may contain the address of a </span><span class="style4">Person</span><span class="style3"> object, and the second line dynamically allocates space for a </span><span class="style4">Person</span><span class="style3"> object and places its address in the variable </span><span class="style4">ralph</span><span class="style3">.  Using machine addresses like this is very common in C, and is discussed later in this chapter.
  9354.  
  9355. A method is invoked by sending the appropriate </span><span class="style7">message</span><span class="style3"> to the object.  (This is identical to "calling a procedure" in a procedural language, but we will use the OOP terminology since this leads to a more natural understanding of the program.)  To set and print </span><span class="style4">ralph</span><span class="style3">'s instance variables, we would send the messages:
  9356.  
  9357. </span><span class="style4">    ralph->set();
  9358.     ralph->print();
  9359. </span><span class="style3">
  9360. </span></text>
  9361.     </content>
  9362.     <content>
  9363.         <layer>background</layer>
  9364.         <id>7</id>
  9365.         <text>17</text>
  9366.     </content>
  9367.     <name></name>
  9368.     <script></script>
  9369. </card>
  9370.  
  9371.  
  9372. card_4342.xml
  9373. <?xml version="1.0" encoding="utf-8" ?>
  9374. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9375. <card>
  9376.     <id>4342</id>
  9377.     <filler1>0</filler1>
  9378.     <cantDelete> <false /> </cantDelete>
  9379.     <showPict> <true /> </showPict>
  9380.     <dontSearch> <false /> </dontSearch>
  9381.     <owner>4755</owner>
  9382.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9383.     <content>
  9384.         <layer>background</layer>
  9385.         <id>6</id>
  9386.         <text>1.1  The Person Program</text>
  9387.     </content>
  9388.     <content>
  9389.         <layer>background</layer>
  9390.         <id>7</id>
  9391.         <text>18</text>
  9392.     </content>
  9393.     <content>
  9394.         <layer>background</layer>
  9395.         <id>4</id>
  9396.         <text><span class="style3">he following page contains a complete TC/C++ program using the </span><span class="style4">Person</span><span class="style3"> class defined earlier.  You can copy the program from the scrolling text field, paste it into a new source file called </span><span class="style18">person.c</span><span class="style3">, then compile* and run it.  Note that one change must be made if you are using C++ instead of TC, as discussed below.
  9397.  
  9398. </span></text>
  9399.     </content>
  9400.     <content>
  9401.         <layer>background</layer>
  9402.         <id>29</id>
  9403.         <text>3295</text>
  9404.     </content>
  9405.     <content>
  9406.         <layer>background</layer>
  9407.         <id>27</id>
  9408.         <text>Compiling TC applications</text>
  9409.     </content>
  9410.     <content>
  9411.         <layer>background</layer>
  9412.         <id>20</id>
  9413.         <text>Compiling TC applications - p248</text>
  9414.     </content>
  9415.     <name>chapter 1</name>
  9416.     <script></script>
  9417. </card>
  9418.  
  9419.  
  9420. card_29372.xml
  9421. <?xml version="1.0" encoding="utf-8" ?>
  9422. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9423. <card>
  9424.     <id>29372</id>
  9425.     <filler1>0</filler1>
  9426.     <cantDelete> <false /> </cantDelete>
  9427.     <showPict> <true /> </showPict>
  9428.     <dontSearch> <false /> </dontSearch>
  9429.     <owner>4755</owner>
  9430.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9431.     <part>
  9432.         <id>1</id>
  9433.         <type>field</type>
  9434.         <visible> <true /> </visible>
  9435.         <dontWrap> <false /> </dontWrap>
  9436.         <dontSearch> <false /> </dontSearch>
  9437.         <sharedText> <false /> </sharedText>
  9438.         <fixedLineHeight> <true /> </fixedLineHeight>
  9439.         <autoTab> <false /> </autoTab>
  9440.         <lockText> <false /> </lockText>
  9441.         <rect>
  9442.             <left>30</left>
  9443.             <top>78</top>
  9444.             <right>478</right>
  9445.             <bottom>296</bottom>
  9446.         </rect>
  9447.         <style>scrolling</style>
  9448.         <autoSelect> <false /> </autoSelect>
  9449.         <showLines> <false /> </showLines>
  9450.         <wideMargins> <false /> </wideMargins>
  9451.         <multipleLines> <false /> </multipleLines>
  9452.         <reservedFamily> 0 </reservedFamily>
  9453.         <titleWidth>0</titleWidth>
  9454.         <icon>0</icon>
  9455.         <textAlign>left</textAlign>
  9456.         <font>Monaco</font>
  9457.         <textSize>9</textSize>
  9458.         <textStyle>plain</textStyle>
  9459.         <textHeight>12</textHeight>
  9460.         <name>code</name>
  9461.         <script></script>
  9462.     </part>
  9463.     <part>
  9464.         <id>3</id>
  9465.         <type>button</type>
  9466.         <visible> <true /> </visible>
  9467.         <reserved5> 0 </reserved5>
  9468.         <reserved4> 0 </reserved4>
  9469.         <reserved3> 0 </reserved3>
  9470.         <reserved2> 0 </reserved2>
  9471.         <reserved1> 0 </reserved1>
  9472.         <enabled> <true /> </enabled>
  9473.         <rect>
  9474.             <left>13</left>
  9475.             <top>29</top>
  9476.             <right>351</right>
  9477.             <bottom>57</bottom>
  9478.         </rect>
  9479.         <style>opaque</style>
  9480.         <showName> <false /> </showName>
  9481.         <highlight> <false /> </highlight>
  9482.         <autoHighlight> <false /> </autoHighlight>
  9483.         <sharedHighlight> <true /> </sharedHighlight>
  9484.         <family>0</family>
  9485.         <titleWidth>0</titleWidth>
  9486.         <icon>0</icon>
  9487.         <textAlign>center</textAlign>
  9488.         <font>Chicago</font>
  9489.         <textSize>12</textSize>
  9490.         <textStyle>plain</textStyle>
  9491.         <name>New Button</name>
  9492.         <script></script>
  9493.     </part>
  9494.     <part>
  9495.         <id>4</id>
  9496.         <type>button</type>
  9497.         <visible> <true /> </visible>
  9498.         <reserved5> 0 </reserved5>
  9499.         <reserved4> 0 </reserved4>
  9500.         <reserved3> 0 </reserved3>
  9501.         <reserved2> 0 </reserved2>
  9502.         <reserved1> 0 </reserved1>
  9503.         <enabled> <true /> </enabled>
  9504.         <rect>
  9505.             <left>169</left>
  9506.             <top>32</top>
  9507.             <right>305</right>
  9508.             <bottom>54</bottom>
  9509.         </rect>
  9510.         <style>roundrect</style>
  9511.         <showName> <true /> </showName>
  9512.         <highlight> <false /> </highlight>
  9513.         <autoHighlight> <true /> </autoHighlight>
  9514.         <sharedHighlight> <true /> </sharedHighlight>
  9515.         <family>0</family>
  9516.         <titleWidth>0</titleWidth>
  9517.         <icon>0</icon>
  9518.         <textAlign>center</textAlign>
  9519.         <font>Chicago</font>
  9520.         <textSize>12</textSize>
  9521.         <textStyle>plain</textStyle>
  9522.         <name>Copy to Clipboard</name>
  9523.         <script>on mouseUp
  9524. set lockscreen to true
  9525. select text of card field "code"
  9526. domenu "Copy Text"
  9527. select empty
  9528. set lockscreen to false
  9529. end mouseUp</script>
  9530.     </part>
  9531.     <content>
  9532.         <layer>card</layer>
  9533.         <id>1</id>
  9534.         <text>/*
  9535. *   FILE:    person.c
  9536. *   AUTHOR:  R.G.
  9537. *   CREATED: June 4, 1990
  9538. *   
  9539. *   Think C/C++ program illustrating use of the Person class.
  9540. *
  9541. *   PROJECT CONTENTS:
  9542. *   person.c, ANSI, oops libraries
  9543. */
  9544.  
  9545. # include <stdio.h>
  9546.  
  9547. /******************************************************************
  9548. *   Definition of Person class and its methods
  9549. ******************************************************************/
  9550. struct Person:indirect   // for C++ omit ":indirect"
  9551. {
  9552.     int     age;
  9553.     int     weight;
  9554.  
  9555.     void    set(void);
  9556.     void    print(void);
  9557. };
  9558.  
  9559. void    Person::set(void)
  9560. {
  9561.     int     new_age,
  9562.             new_weight;
  9563.  
  9564.     printf("Enter age and weight separated by spaces:\n");
  9565.     scanf("%d %d",&new_age,&new_weight);
  9566.  
  9567.     age = new_age;
  9568.     weight = new_weight;
  9569. }
  9570.  
  9571. void    Person::print(void)
  9572. {
  9573.     printf("My age is %d\n",age);
  9574.     printf("My weight is %d\n",weight);
  9575. }
  9576.  
  9577. /******************************************************************
  9578. *   main() function
  9579. ******************************************************************/
  9580. main()
  9581. {
  9582.     Person  *person;
  9583.  
  9584.     person = new Person;
  9585.     person->set();
  9586.     person->print();
  9587.     delete person;
  9588. }
  9589.  
  9590. </text>
  9591.     </content>
  9592.     <content>
  9593.         <layer>background</layer>
  9594.         <id>6</id>
  9595.         <text>Simple Person class example</text>
  9596.     </content>
  9597.     <content>
  9598.         <layer>background</layer>
  9599.         <id>4</id>
  9600.         <text><span class="style3"> complete TC/C++ program using the </span><span class="style4">Person</span><span class="style3"> class:
  9601.  
  9602.  
  9603.  
  9604.  
  9605.  
  9606.  
  9607.  
  9608.  
  9609.  
  9610.  
  9611.  
  9612.  
  9613.  
  9614.  
  9615.  
  9616.  
  9617.  
  9618. </span></text>
  9619.     </content>
  9620.     <content>
  9621.         <layer>background</layer>
  9622.         <id>7</id>
  9623.         <text>19</text>
  9624.     </content>
  9625.     <name></name>
  9626.     <script></script>
  9627. </card>
  9628.  
  9629.  
  9630. card_11423.xml
  9631. <?xml version="1.0" encoding="utf-8" ?>
  9632. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9633. <card>
  9634.     <id>11423</id>
  9635.     <filler1>0</filler1>
  9636.     <cantDelete> <false /> </cantDelete>
  9637.     <showPict> <true /> </showPict>
  9638.     <dontSearch> <false /> </dontSearch>
  9639.     <owner>4755</owner>
  9640.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9641.     <content>
  9642.         <layer>background</layer>
  9643.         <id>4</id>
  9644.         <text><span class="style3">ample output is shown below, with the user's responses in <> braces.
  9645.  
  9646. </span><span class="style9">    Enter age and weight separated by spaces:
  9647.     <35  175>
  9648.     My age is 35
  9649.     My weight is 175
  9650. </span><span class="style3">
  9651. Let's step through the code and discuss some new items.  (You may wish to put a bookmark in the previous page so you can return to it easily.  Click on its "book" icon.)
  9652.  
  9653. </span></text>
  9654.     </content>
  9655.     <content>
  9656.         <layer>background</layer>
  9657.         <id>7</id>
  9658.         <text>20</text>
  9659.     </content>
  9660.     <name></name>
  9661.     <script></script>
  9662. </card>
  9663.  
  9664.  
  9665. card_12984.xml
  9666. <?xml version="1.0" encoding="utf-8" ?>
  9667. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9668. <card>
  9669.     <id>12984</id>
  9670.     <filler1>0</filler1>
  9671.     <cantDelete> <false /> </cantDelete>
  9672.     <showPict> <true /> </showPict>
  9673.     <dontSearch> <false /> </dontSearch>
  9674.     <owner>4755</owner>
  9675.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9676.     <content>
  9677.         <layer>background</layer>
  9678.         <id>4</id>
  9679.         <text><span class="style4">   /*
  9680.     *   FILE:    person.c
  9681.     *   AUTHOR:  R.G.
  9682.     ...
  9683. </span><span class="style3">
  9684. Everything between the </span><span class="style4">/*</span><span class="style3"> symbol and the </span><span class="style4">*/</span><span class="style3"> symbol is a </span><span class="style7">comment</span><span class="style3">, and is ignored by the compiler.  A good C program should </span><span class="style7">not</span><span class="style3"> rely upon comments to impart its structure; however, it is good practice to identify the important parts of your source code and any unusual constructs.
  9685.  
  9686. An alternative syntax for comments is available in TC/C++:  anything between the </span><span class="style4">//</span><span class="style3"> symbol and the end of a line is ignored.
  9687.  
  9688. The C compiler also ignores </span><span class="style7">white space</span><span class="style3"> such as blank lines and tabs, allowing the programmer to use his/her preferred formatting.  Judicious use of white space helps improve the readability of the program.
  9689. </span></text>
  9690.     </content>
  9691.     <content>
  9692.         <layer>background</layer>
  9693.         <id>7</id>
  9694.         <text>21</text>
  9695.     </content>
  9696.     <name></name>
  9697.     <script></script>
  9698. </card>
  9699.  
  9700.  
  9701. card_11521.xml
  9702. <?xml version="1.0" encoding="utf-8" ?>
  9703. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9704. <card>
  9705.     <id>11521</id>
  9706.     <filler1>0</filler1>
  9707.     <cantDelete> <false /> </cantDelete>
  9708.     <showPict> <true /> </showPict>
  9709.     <dontSearch> <false /> </dontSearch>
  9710.     <owner>4755</owner>
  9711.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9712.     <content>
  9713.         <layer>background</layer>
  9714.         <id>7</id>
  9715.         <text>22</text>
  9716.     </content>
  9717.     <content>
  9718.         <layer>background</layer>
  9719.         <id>4</id>
  9720.         <text><span class="style4">   # include <stdio.h>
  9721. </span><span class="style3">
  9722. '</span><span class="style4"># include</span><span class="style3">' is a </span><span class="style7">preprocessor directive</span><span class="style3">, identified by the </span><span class="style4">#</span><span class="style3"> symbol.  The C preprocessor carries out text-manipulation directives as a preliminary step to compilation.  This one directs the preprocessor to "paste" the text from the indicated file into this file before compilation.  The included file </span><span class="style18">stdio.h</span><span class="style3"> is called a </span><span class="style7">header</span><span class="style3"> file, and contains C source code declaring constants, data structures, and/or library functions which we will use in this program.
  9723.  
  9724. The C language is very terse, but is readily extended by the use of headers and function libraries.
  9725.  
  9726. </span></text>
  9727.     </content>
  9728.     <content>
  9729.         <layer>background</layer>
  9730.         <id>17</id>
  9731.         <text>p223</text>
  9732.     </content>
  9733.     <name></name>
  9734.     <script></script>
  9735. </card>
  9736.  
  9737.  
  9738. card_12751.xml
  9739. <?xml version="1.0" encoding="utf-8" ?>
  9740. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9741. <card>
  9742.     <id>12751</id>
  9743.     <filler1>0</filler1>
  9744.     <cantDelete> <false /> </cantDelete>
  9745.     <showPict> <true /> </showPict>
  9746.     <dontSearch> <false /> </dontSearch>
  9747.     <owner>4755</owner>
  9748.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9749.     <content>
  9750.         <layer>background</layer>
  9751.         <id>4</id>
  9752.         <text><span class="style4">   struct Person:indirect   // for C++ omit ":indirect"
  9753. </span><span class="style3">
  9754. In C, the keyword </span><span class="style4">struct</span><span class="style3"> is used to define a new type of </span><span class="style7">data structure</span><span class="style3"> of the programmer's choice.  That is, a variable defined with this new type can represent a collection (data record) of integer, character, and floating-point variables, called "members".  This collection is described in a list enclosed by {} braces.
  9755.  
  9756. TC and C++ extend this idea so that the data structure may be a </span><span class="style7">class</span><span class="style3">.  Objects defined with this type represent a collection of instance variables </span><span class="style7">and</span><span class="style3"> the methods ‚Äî or "member functions" ‚Äî which may act upon them.  In this case, when an object of type </span><span class="style4">Person</span><span class="style3"> is defined later in the program, space will be allocated for two integer variables which may be accessed by sending set and print messages to the object.
  9757.  
  9758. The word </span><span class="style4">indirect</span><span class="style3"> is unique to TC, and specifies how TC should implement objects of class </span><span class="style4">Person</span><span class="style3">.  The significance of this implementation will be discussed later.*  To compile this program with C++, you omit the "</span><span class="style4">:indirect</span><span class="style3">". 
  9759. </span></text>
  9760.     </content>
  9761.     <content>
  9762.         <layer>background</layer>
  9763.         <id>7</id>
  9764.         <text>23</text>
  9765.     </content>
  9766.     <content>
  9767.         <layer>background</layer>
  9768.         <id>29</id>
  9769.         <text>38494</text>
  9770.     </content>
  9771.     <content>
  9772.         <layer>background</layer>
  9773.         <id>27</id>
  9774.         <text>Macintosh memory management</text>
  9775.     </content>
  9776.     <content>
  9777.         <layer>background</layer>
  9778.         <id>20</id>
  9779.         <text>Macintosh memory management - p158</text>
  9780.     </content>
  9781.     <name></name>
  9782.     <script></script>
  9783. </card>
  9784.  
  9785.  
  9786. card_15137.xml
  9787. <?xml version="1.0" encoding="utf-8" ?>
  9788. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9789. <card>
  9790.     <id>15137</id>
  9791.     <filler1>0</filler1>
  9792.     <cantDelete> <false /> </cantDelete>
  9793.     <showPict> <true /> </showPict>
  9794.     <dontSearch> <false /> </dontSearch>
  9795.     <owner>4755</owner>
  9796.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9797.     <content>
  9798.         <layer>background</layer>
  9799.         <id>4</id>
  9800.         <text><span class="style4">   int     age;
  9801.     int     weight;
  9802. </span><span class="style3">
  9803. These statements declare the instance variables </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> to be of </span><span class="style7">type</span><span class="style3"> </span><span class="style4">int</span><span class="style3"> (integer).  The remaining basic data types offered in C are </span><span class="style4">char</span><span class="style3"> (character) and </span><span class="style4">float</span><span class="style3"> (floating-point number), as well as larger and higher-precision kinds of integer and floating-point variables.
  9804.  
  9805. A note about usage in this document:  a </span><span class="style7">definition</span><span class="style3"> is something which describes the structure of or allocates space for something, whereas a </span><span class="style7">declaration</span><span class="style3"> simply identifies the thing so the compiler is not confused.  A </span><span class="style4">struct</span><span class="style3"> expression may be thought of as "declaring" the instance variables and methods of a class.  However, although no space is yet allocated for a </span><span class="style4">Person</span><span class="style3"> object, the </span><span class="style4">struct</span><span class="style3"> expression "defines" the </span><span class="style4">Person</span><span class="style3"> class by describing its structure.  (Definitions are usually implicitly declarations, while declarations need not define anything.)
  9806.  
  9807. Notice that a semicolon terminates simple C statements like the declaration "</span><span class="style4">int</span></text>
  9808.     </content>
  9809.     <content>
  9810.         <layer>background</layer>
  9811.         <id>7</id>
  9812.         <text>24</text>
  9813.     </content>
  9814.     <content>
  9815.         <layer>background</layer>
  9816.         <id>17</id>
  9817.         <text>p202</text>
  9818.     </content>
  9819.     <name></name>
  9820.     <script></script>
  9821. </card>
  9822.  
  9823.  
  9824. card_15503.xml
  9825. <?xml version="1.0" encoding="utf-8" ?>
  9826. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9827. <card>
  9828.     <id>15503</id>
  9829.     <filler1>0</filler1>
  9830.     <cantDelete> <false /> </cantDelete>
  9831.     <showPict> <true /> </showPict>
  9832.     <dontSearch> <false /> </dontSearch>
  9833.     <owner>4755</owner>
  9834.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9835.     <content>
  9836.         <layer>background</layer>
  9837.         <id>4</id>
  9838.         <text><span class="style4">ge;</span><span class="style3">'.  A compound statement like a function body is enclosed by {} braces and is not followed by a semicolon.
  9839.  
  9840. However, the trailing semicolon </span><span class="style7">is</span><span class="style3"> required in the </span><span class="style4">struct</span><span class="style3"> declaration since its syntax requires an additional statement following the compound statement.  In this case the statement is simply the "null" statement: a lone semicolon following the closing brace.
  9841.  
  9842. Also note that some programmers prefer an alternate bracket format which is treated identically by the compiler (since line feeds are ignored "white space"):
  9843.  
  9844. </span><span class="style4">    struct Person:indirect {
  9845.         int     age;
  9846.         int     weight;
  9847.  
  9848.         void    set(void);
  9849.         void    print(void);
  9850.     };   
  9851. </span><span class="style3">
  9852.  
  9853. </span></text>
  9854.     </content>
  9855.     <content>
  9856.         <layer>background</layer>
  9857.         <id>7</id>
  9858.         <text>25</text>
  9859.     </content>
  9860.     <content>
  9861.         <layer>background</layer>
  9862.         <id>17</id>
  9863.         <text>p215</text>
  9864.     </content>
  9865.     <name></name>
  9866.     <script></script>
  9867. </card>
  9868.  
  9869.  
  9870. card_13249.xml
  9871. <?xml version="1.0" encoding="utf-8" ?>
  9872. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9873. <card>
  9874.     <id>13249</id>
  9875.     <filler1>0</filler1>
  9876.     <cantDelete> <false /> </cantDelete>
  9877.     <showPict> <true /> </showPict>
  9878.     <dontSearch> <false /> </dontSearch>
  9879.     <owner>4755</owner>
  9880.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9881.     <content>
  9882.         <layer>background</layer>
  9883.         <id>4</id>
  9884.         <text><span class="style4">   void    set(void);
  9885.     void    print(void);
  9886. </span><span class="style3">
  9887. As mentioned above, class definitions in TC may declare what methods are members of the class.  This declaration for the </span><span class="style4">set()</span><span class="style3"> method is a little different from the one used in the beginning of this chapter.*  In C, all procedures are functions, which may </span><span class="style7">return</span><span class="style3"> a value upon completion.  If we wish to declare a function which does not return a value, we say it returns </span><span class="style4">void</span><span class="style3">.  The declaration for the </span><span class="style4">set()</span><span class="style3"> method also indicates that this function has no </span><span class="style7">arguments</span><span class="style3">; i.e., a </span><span class="style4">void</span><span class="style3"> argument.  It is good practice to explicitly state the types of values accepted by and returned by C functions, to allow the compiler to enforce type-checking.
  9888. </span></text>
  9889.     </content>
  9890.     <content>
  9891.         <layer>background</layer>
  9892.         <id>7</id>
  9893.         <text>26</text>
  9894.     </content>
  9895.     <content>
  9896.         <layer>background</layer>
  9897.         <id>29</id>
  9898.         <text>7205</text>
  9899.     </content>
  9900.     <content>
  9901.         <layer>background</layer>
  9902.         <id>27</id>
  9903.         <text>Previous declaration</text>
  9904.     </content>
  9905.     <content>
  9906.         <layer>background</layer>
  9907.         <id>20</id>
  9908.         <text>Previous declaration - p15</text>
  9909.     </content>
  9910.     <name></name>
  9911.     <script></script>
  9912. </card>
  9913.  
  9914.  
  9915. card_13426.xml
  9916. <?xml version="1.0" encoding="utf-8" ?>
  9917. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9918. <card>
  9919.     <id>13426</id>
  9920.     <filler1>0</filler1>
  9921.     <cantDelete> <false /> </cantDelete>
  9922.     <showPict> <true /> </showPict>
  9923.     <dontSearch> <false /> </dontSearch>
  9924.     <owner>4755</owner>
  9925.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9926.     <content>
  9927.         <layer>background</layer>
  9928.         <id>4</id>
  9929.         <text><span class="style4">   void    Person::set(void)
  9930. </span><span class="style3">
  9931. This begins the definition for the </span><span class="style4">set()</span><span class="style3"> method, or member function.  The </span><span class="style7">scope resolution operator</span><span class="style4"> :: </span><span class="style3">is required in order to indicate that this function is a member of the </span><span class="style4">Person</span><span class="style3"> class, as previously declared.  (It is legal to have several functions with the same name as long as they are members of different classes.)  Again, the types of the return value and of the formal parameters (none in this case) are given.
  9932.  
  9933. The function body is enclosed in {} braces, and assigns new values to the instance variables </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3">.
  9934.  
  9935.  
  9936.  
  9937.  
  9938.  
  9939.  
  9940.  
  9941.  
  9942. </span></text>
  9943.     </content>
  9944.     <content>
  9945.         <layer>background</layer>
  9946.         <id>7</id>
  9947.         <text>27</text>
  9948.     </content>
  9949.     <content>
  9950.         <layer>background</layer>
  9951.         <id>17</id>
  9952.         <text>p153</text>
  9953.     </content>
  9954.     <name></name>
  9955.     <script></script>
  9956. </card>
  9957.  
  9958.  
  9959. card_17184.xml
  9960. <?xml version="1.0" encoding="utf-8" ?>
  9961. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  9962. <card>
  9963.     <id>17184</id>
  9964.     <filler1>0</filler1>
  9965.     <cantDelete> <false /> </cantDelete>
  9966.     <showPict> <true /> </showPict>
  9967.     <dontSearch> <false /> </dontSearch>
  9968.     <owner>4755</owner>
  9969.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  9970.     <content>
  9971.         <layer>background</layer>
  9972.         <id>4</id>
  9973.         <text><span class="style4">   int     new_age,
  9974.             new_weight;
  9975. </span><span class="style3">
  9976. There are various combinations of </span><span class="style7">scope</span><span class="style3"> and </span><span class="style7">storage class</span><span class="style3"> for C variables.  </span><span class="style7">automatic</span><span class="style3"> variables are those whose storage class is "dynamic":  they are allocated upon entry to the function body in which they are declared and deallocated upon completion of the function.  The scope of an automatic variable is the function in which it is defined (i.e., it is "local" to this function).
  9977.  
  9978. In a function body such as </span><span class="style4">Person::set()</span><span class="style3">, the automatic storage class is default, so "</span><span class="style4">int new_age</span><span class="style3">" is short for "</span><span class="style4">auto int new_age</span><span class="style3">".  (Spaces are not permitted in variable or function names, so the underscore character </span><span class="style4">_</span><span class="style3"> is frequently used.)  This declares </span><span class="style4">new_age</span><span class="style3"> to be a variable of type </span><span class="style4">int</span><span class="style3"> (integer) and also serves as a definition, allocating space for this variable.  Automatic variables are not initialized in C, so we cannot generally count on </span><span class="style4">new_age</span><span class="style3"> to contain 0 ‚Äî or even a legal value ‚Äî until we've assigned it a value.  (Actually, the default implementation of objects in Think C 5.0 causes their instance variables to be initialized to 0, but it is poor practice to count on 
  9979. </span></text>
  9980.     </content>
  9981.     <content>
  9982.         <layer>background</layer>
  9983.         <id>7</id>
  9984.         <text>28</text>
  9985.     </content>
  9986.     <content>
  9987.         <layer>background</layer>
  9988.         <id>17</id>
  9989.         <text>p66</text>
  9990.     </content>
  9991.     <content>
  9992.         <layer>background</layer>
  9993.         <id>18</id>
  9994.         <text>p59</text>
  9995.     </content>
  9996.     <name></name>
  9997.     <script></script>
  9998. </card>
  9999.  
  10000.  
  10001. card_18361.xml
  10002. <?xml version="1.0" encoding="utf-8" ?>
  10003. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10004. <card>
  10005.     <id>18361</id>
  10006.     <filler1>0</filler1>
  10007.     <cantDelete> <false /> </cantDelete>
  10008.     <showPict> <true /> </showPict>
  10009.     <dontSearch> <false /> </dontSearch>
  10010.     <owner>4755</owner>
  10011.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10012.     <content>
  10013.         <layer>background</layer>
  10014.         <id>4</id>
  10015.         <text><span class="style3">his.)
  10016.  
  10017. Notice that the instance variables </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> have </span><span class="style7">class</span><span class="style3"> scope and can be accessed directly from within the body of this member function even though they are neither formal parameters nor are they defined within the body of the function.
  10018.  
  10019.  
  10020.  
  10021.  
  10022.  
  10023.  
  10024.  
  10025.  
  10026.  
  10027.  
  10028.  
  10029.  
  10030.  
  10031.  
  10032.  
  10033.  
  10034. </span></text>
  10035.     </content>
  10036.     <content>
  10037.         <layer>background</layer>
  10038.         <id>7</id>
  10039.         <text>29</text>
  10040.     </content>
  10041.     <content>
  10042.         <layer>background</layer>
  10043.         <id>17</id>
  10044.         <text>p64</text>
  10045.     </content>
  10046.     <content>
  10047.         <layer>background</layer>
  10048.         <id>18</id>
  10049.         <text>p130</text>
  10050.     </content>
  10051.     <name></name>
  10052.     <script></script>
  10053. </card>
  10054.  
  10055.  
  10056. card_16926.xml
  10057. <?xml version="1.0" encoding="utf-8" ?>
  10058. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10059. <card>
  10060.     <id>16926</id>
  10061.     <filler1>0</filler1>
  10062.     <cantDelete> <false /> </cantDelete>
  10063.     <showPict> <true /> </showPict>
  10064.     <dontSearch> <false /> </dontSearch>
  10065.     <owner>4755</owner>
  10066.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10067.     <content>
  10068.         <layer>background</layer>
  10069.         <id>4</id>
  10070.         <text><span class="style4">   printf("Enter age and weight separated by spaces:\n");
  10071. </span><span class="style3">
  10072. </span><span class="style4">printf()</span><span class="style3"> is a function defined in the ANSI library, for formatted output to the </span><span class="style7">standard output</span><span class="style3"> device ‚Äî usually the screen.  (On UNIX systems, </span><span class="style4">printf()</span><span class="style3"> output can be redirected to a file; this is done in TC using the </span><span class="style4">ccommand()</span><span class="style3"> library function.)
  10073.  
  10074. </span><span class="style4">printf()</span><span class="style3"> accepts a character string (actually an array of </span><span class="style4">char</span><span class="style3"> variables) as its first argument, optionally followed by additional arguments.  The escape sequence '</span><span class="style4">\n</span><span class="style3">' in the character string tells C to begin a new line following this output.
  10075.  
  10076. Notice that all function calls in C are expressions which represent a value (or </span><span class="style4">void</span><span class="style3">).  In fact, </span><span class="style4">printf()</span><span class="style3"> returns the number of characters successfully printed, but we are ignoring this value here.
  10077.  
  10078. If a function is used in a C source file, the compiler requires either a declaration or a definition of the function in the source file.  The declaration for </span><span class="style4">printf()</span><span class="style3"> is con- tained in the file </span><span class="style18">stdio.h</span><span class="style3">, which was included into this file via the preprocessor.*
  10079.  
  10080.  
  10081. </span></text>
  10082.     </content>
  10083.     <content>
  10084.         <layer>background</layer>
  10085.         <id>27</id>
  10086.         <text>Header files</text>
  10087.     </content>
  10088.     <content>
  10089.         <layer>background</layer>
  10090.         <id>29</id>
  10091.         <text>11521</text>
  10092.     </content>
  10093.     <content>
  10094.         <layer>background</layer>
  10095.         <id>20</id>
  10096.         <text>Header files - p22</text>
  10097.     </content>
  10098.     <content>
  10099.         <layer>background</layer>
  10100.         <id>7</id>
  10101.         <text>30</text>
  10102.     </content>
  10103.     <name></name>
  10104.     <script></script>
  10105. </card>
  10106.  
  10107.  
  10108. card_13648.xml
  10109. <?xml version="1.0" encoding="utf-8" ?>
  10110. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10111. <card>
  10112.     <id>13648</id>
  10113.     <filler1>0</filler1>
  10114.     <cantDelete> <false /> </cantDelete>
  10115.     <showPict> <true /> </showPict>
  10116.     <dontSearch> <false /> </dontSearch>
  10117.     <owner>4755</owner>
  10118.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10119.     <content>
  10120.         <layer>background</layer>
  10121.         <id>7</id>
  10122.         <text>31</text>
  10123.     </content>
  10124.     <content>
  10125.         <layer>background</layer>
  10126.         <id>4</id>
  10127.         <text><span class="style4">   scanf("%d %d",&new_age,&new_weight);
  10128. </span><span class="style3">
  10129. Like </span><span class="style4">printf()</span><span class="style3">, </span><span class="style4">scanf()</span><span class="style3"> is defined in the ANSI library and declared in </span><span class="style18">stdio.h</span><span class="style3">.  This function reads formatted values from the standard input device (usually the keyboard) and "returns" them as discussed below.  Its syntax is similar to </span><span class="style4">printf()</span><span class="style3">'s: the first argument is a character string containing (only!) formatting characteristics.  </span><span class="style4">%d</span><span class="style3"> indicates that an integer is expected from the input device.  Following the string is a list of the variables associated with each format specifier.
  10130.  
  10131. C functions use </span><span class="style7">call by value</span><span class="style3"> rather than </span><span class="style7">call by reference</span><span class="style3">.  This means that values passed as arguments to a function are assigned to the function's formal parameters, but any changes to the values of these formal parameters within the body of the called function do not affect the values of those variables in the calling function which were passed as arguments.
  10132.  
  10133. However, the above call to the </span><span class="style4">scanf()</span><span class="style3"> function </span><span class="style7">does</span><span class="style3"> change the values of </span><span class="style4">new_age</span><span class="style3"> and </span><span class="style4">new_weight</span><span class="style3"> in the calling function.  The reason is that the </span><span class="style7">address</span><span class="style3"> of these </span></text>
  10134.     </content>
  10135.     <content>
  10136.         <layer>background</layer>
  10137.         <id>17</id>
  10138.         <text>p223</text>
  10139.     </content>
  10140.     <name></name>
  10141.     <script></script>
  10142. </card>
  10143.  
  10144.  
  10145. card_17666.xml
  10146. <?xml version="1.0" encoding="utf-8" ?>
  10147. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10148. <card>
  10149.     <id>17666</id>
  10150.     <filler1>0</filler1>
  10151.     <cantDelete> <false /> </cantDelete>
  10152.     <showPict> <true /> </showPict>
  10153.     <dontSearch> <false /> </dontSearch>
  10154.     <owner>4755</owner>
  10155.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10156.     <content>
  10157.         <layer>background</layer>
  10158.         <id>4</id>
  10159.         <text><span class="style3">ariables is passed, rather than their contents.  This is accomplished with the </span><span class="style4">&</span><span class="style3"> ("address of") operator.  The formal parameters of </span><span class="style4">scanf()</span><span class="style3"> now "point to" the </span><span class="style4">new_age</span><span class="style3"> and </span><span class="style4">new_weight</span><span class="style3"> variables defined in the </span><span class="style4">Person::set()</span><span class="style3"> function.  </span><span class="style4">scanf()</span><span class="style3"> reads values from the standard input and assigns them to the variables "pointed to" by its parameters.
  10160.  
  10161. Incidentally, </span><span class="style4">scanf()</span><span class="style3"> also returns a value in the conventional sense:  the number of items successfully read.  As done here, it is common ‚Äî but somewhat risky ‚Äî to ignore this returned value.
  10162.  
  10163.  
  10164.  
  10165.  
  10166.  
  10167.  
  10168.  
  10169.  
  10170.  
  10171.  
  10172. </span></text>
  10173.     </content>
  10174.     <content>
  10175.         <layer>background</layer>
  10176.         <id>7</id>
  10177.         <text>32</text>
  10178.     </content>
  10179.     <content>
  10180.         <layer>background</layer>
  10181.         <id>17</id>
  10182.         <text>p153</text>
  10183.     </content>
  10184.     <name></name>
  10185.     <script></script>
  10186. </card>
  10187.  
  10188.  
  10189. card_18162.xml
  10190. <?xml version="1.0" encoding="utf-8" ?>
  10191. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10192. <card>
  10193.     <id>18162</id>
  10194.     <filler1>0</filler1>
  10195.     <cantDelete> <false /> </cantDelete>
  10196.     <showPict> <true /> </showPict>
  10197.     <dontSearch> <false /> </dontSearch>
  10198.     <owner>4755</owner>
  10199.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10200.     <content>
  10201.         <layer>background</layer>
  10202.         <id>4</id>
  10203.         <text><span class="style4">   age = new_age;
  10204.     weight = new_weight;
  10205. </span><span class="style3">
  10206. Here, the instance variables are assigned the values requested from the user in the foregoing </span><span class="style4">scanf()</span><span class="style3"> function call.
  10207.  
  10208. Interestingly, assignments are expressions in C, as are function calls.  That is, the expression "</span><span class="style4">age = new_age</span><span class="style3">" has a value; namely, the value which was assigned.  This means that assignments can be freely used within other expressions, such as "</span><span class="style4">weight = 4*(age = new_age)/7</span><span class="style3">".
  10209.  
  10210. Another important thing to notice is that we defined new automatic variables </span><span class="style4">new_age</span><span class="style3"> and </span><span class="style4">new_weight</span><span class="style3"> instead of simply passing </span><span class="style4">scanf()</span><span class="style3"> the addresses of the </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables.  For reasons discussed later, TC's management of objects makes it dangerous to pass the address of an instance variable as an argument to certain functions.*  This is not the case with standard C++.  That is, in C++ the program will work equally well if you use "</span><span class="style4">scanf("%d %d",&age,&weight)</span><span class="style3">".</span></text>
  10211.     </content>
  10212.     <content>
  10213.         <layer>background</layer>
  10214.         <id>27</id>
  10215.         <text>Macintosh memory management</text>
  10216.     </content>
  10217.     <content>
  10218.         <layer>background</layer>
  10219.         <id>20</id>
  10220.         <text>Macintosh memory management - p158</text>
  10221.     </content>
  10222.     <content>
  10223.         <layer>background</layer>
  10224.         <id>7</id>
  10225.         <text>33</text>
  10226.     </content>
  10227.     <content>
  10228.         <layer>background</layer>
  10229.         <id>29</id>
  10230.         <text>38494</text>
  10231.     </content>
  10232.     <name></name>
  10233.     <script></script>
  10234. </card>
  10235.  
  10236.  
  10237. card_13900.xml
  10238. <?xml version="1.0" encoding="utf-8" ?>
  10239. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10240. <card>
  10241.     <id>13900</id>
  10242.     <filler1>0</filler1>
  10243.     <cantDelete> <false /> </cantDelete>
  10244.     <showPict> <true /> </showPict>
  10245.     <dontSearch> <false /> </dontSearch>
  10246.     <owner>4755</owner>
  10247.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10248.     <content>
  10249.         <layer>background</layer>
  10250.         <id>4</id>
  10251.         <text><span class="style4">   printf("My age is %d\n",age);
  10252.     printf("My weight is %d\n",weight);
  10253. </span><span class="style3">
  10254. The </span><span class="style4">Person::print()</span><span class="style3"> method outputs the values of the instance variables.
  10255.  
  10256. As mentioned earlier, </span><span class="style4">printf()</span><span class="style3"> accepts a character string as its first argument, followed by an appropriate list of arguments.  The characters </span><span class="style4">%d</span><span class="style3"> contained in the string specify that an integer value is to be printed in this location, in this case the value represented by the variable </span><span class="style4">age</span><span class="style3"> or the variable </span><span class="style4">weight</span><span class="style3">.
  10257.  
  10258.  
  10259. </span></text>
  10260.     </content>
  10261.     <content>
  10262.         <layer>background</layer>
  10263.         <id>7</id>
  10264.         <text>34</text>
  10265.     </content>
  10266.     <content>
  10267.         <layer>background</layer>
  10268.         <id>17</id>
  10269.         <text>p215</text>
  10270.     </content>
  10271.     <name></name>
  10272.     <script></script>
  10273. </card>
  10274.  
  10275.  
  10276. card_14229.xml
  10277. <?xml version="1.0" encoding="utf-8" ?>
  10278. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10279. <card>
  10280.     <id>14229</id>
  10281.     <filler1>0</filler1>
  10282.     <cantDelete> <false /> </cantDelete>
  10283.     <showPict> <true /> </showPict>
  10284.     <dontSearch> <false /> </dontSearch>
  10285.     <owner>4755</owner>
  10286.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10287.     <content>
  10288.         <layer>background</layer>
  10289.         <id>4</id>
  10290.         <text><span class="style4">   main()
  10291. </span><span class="style3">
  10292. Execution of a C program always begins with the function named </span><span class="style4">main()</span><span class="style3">.  (This function, too, may have arguments passed to it.  On UNIX systems the command line provides these arguments, and this is simulated with TC's </span><span class="style4">ccommand()</span><span class="style3"> library function.)
  10293. </span></text>
  10294.     </content>
  10295.     <content>
  10296.         <layer>background</layer>
  10297.         <id>7</id>
  10298.         <text>35</text>
  10299.     </content>
  10300.     <content>
  10301.         <layer>background</layer>
  10302.         <id>17</id>
  10303.         <text>p223</text>
  10304.     </content>
  10305.     <name></name>
  10306.     <script></script>
  10307. </card>
  10308.  
  10309.  
  10310. card_14644.xml
  10311. <?xml version="1.0" encoding="utf-8" ?>
  10312. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10313. <card>
  10314.     <id>14644</id>
  10315.     <filler1>0</filler1>
  10316.     <cantDelete> <false /> </cantDelete>
  10317.     <showPict> <true /> </showPict>
  10318.     <dontSearch> <false /> </dontSearch>
  10319.     <owner>4755</owner>
  10320.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10321.     <content>
  10322.         <layer>background</layer>
  10323.         <id>4</id>
  10324.         <text><span class="style4">   Person  *person;
  10325.  
  10326.     person = new Person;
  10327. </span><span class="style8">
  10328. </span><span class="style3">C is case-sensitive, so it is legal to declare a variable ‚Äî </span><span class="style4">person</span><span class="style3"> ‚Äî of type </span><span class="style4">Person</span><span class="style3">.  In this case, the </span><span class="style4">*</span><span class="style3"> ("that which is pointed to by") operator is used to indicate that person is a </span><span class="style7">pointer</span><span class="style3"> to a Person object.  A pointer is a variable (usually using a long integer internal representation) which may contain the address of a value.  Therefore, this declaration only allocates space for a machine address, </span><span class="style7">not</span><span class="style3"> a Person object or its instance variables.  (In truth, the Macintosh implementation of an object is slightly different, but this will not concern us quite yet.*)
  10329.  
  10330. The </span><span class="style4">new</span><span class="style3"> operator allocates space for a </span><span class="style4">Person</span><span class="style3"> object (i.e., two integer instance variables plus "housekeeping" values used by TC) and returns the machine address where this newly-created object begins.  The object may be accessed via the </span><span class="style4">person</span><span class="style3"> pointer as discussed below.
  10331.  
  10332. </span></text>
  10333.     </content>
  10334.     <content>
  10335.         <layer>background</layer>
  10336.         <id>7</id>
  10337.         <text>36</text>
  10338.     </content>
  10339.     <content>
  10340.         <layer>background</layer>
  10341.         <id>27</id>
  10342.         <text>Macintosh memory management</text>
  10343.     </content>
  10344.     <content>
  10345.         <layer>background</layer>
  10346.         <id>20</id>
  10347.         <text>Macintosh memory management - p158</text>
  10348.     </content>
  10349.     <content>
  10350.         <layer>background</layer>
  10351.         <id>29</id>
  10352.         <text>38494</text>
  10353.     </content>
  10354.     <name></name>
  10355.     <script></script>
  10356. </card>
  10357.  
  10358.  
  10359. card_14948.xml
  10360. <?xml version="1.0" encoding="utf-8" ?>
  10361. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10362. <card>
  10363.     <id>14948</id>
  10364.     <filler1>0</filler1>
  10365.     <cantDelete> <false /> </cantDelete>
  10366.     <showPict> <true /> </showPict>
  10367.     <dontSearch> <false /> </dontSearch>
  10368.     <owner>4755</owner>
  10369.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10370.     <content>
  10371.         <layer>background</layer>
  10372.         <id>4</id>
  10373.         <text><span class="style4">   person->set();
  10374.     person->print();
  10375. </span><span class="style3">
  10376. </span><span class="style4">person</span><span class="style3"> is a pointer variable, containing the machine address of a </span><span class="style4">Person</span><span class="style3"> object.  Although the prospect of accessing an object via its address may be daunting at first, TC/C++ handles all the "dirty work" for you.
  10377.  
  10378. The members ‚Äî instance variables and methods ‚Äî of an object pointed to by a pointer variable are accessed with the </span><span class="style4">-></span><span class="style3"> ("member of the object pointed to by") operator.  Thus, "</span><span class="style4">person->print()</span><span class="style3">" calls the member function </span><span class="style4">print()</span><span class="style3"> of the </span><span class="style4">Person</span><span class="style3"> class, which operates upon the instance variables of the object pointed to by </span><span class="style4">person</span><span class="style3">.  (For simplicity we'll refer to the </span><span class="style4">person</span><span class="style3"> pointer as though it were the object itself).  Using OOP terminology, we are sending a </span><span class="style4">print</span><span class="style3"> message to the </span><span class="style4">person</span><span class="style3">.  Note that if another variable </span><span class="style4">guy</span><span class="style3"> were declared pointing to another </span><span class="style4">Person</span><span class="style3"> object, then "guy-></span><span class="style4">print()</span><span class="style3">" would print the instance variables of this object rather than those of the </span><span class="style4">person</span><span class="style3">.
  10379. </span></text>
  10380.     </content>
  10381.     <content>
  10382.         <layer>background</layer>
  10383.         <id>7</id>
  10384.         <text>37</text>
  10385.     </content>
  10386.     <content>
  10387.         <layer>background</layer>
  10388.         <id>18</id>
  10389.         <text>p207</text>
  10390.     </content>
  10391.     <name></name>
  10392.     <script></script>
  10393. </card>
  10394.  
  10395.  
  10396. card_14487.xml
  10397. <?xml version="1.0" encoding="utf-8" ?>
  10398. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10399. <card>
  10400.     <id>14487</id>
  10401.     <filler1>0</filler1>
  10402.     <cantDelete> <false /> </cantDelete>
  10403.     <showPict> <true /> </showPict>
  10404.     <dontSearch> <false /> </dontSearch>
  10405.     <owner>4755</owner>
  10406.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10407.     <content>
  10408.         <layer>background</layer>
  10409.         <id>4</id>
  10410.         <text><span class="style3">lthough it is possible to access the instance variables of an object directly using the </span><span class="style4">-></span><span class="style3"> notation, this is usually discouraged.  Instead an object's instance variables should be accessed only by sending messages to the object, since this results in improved program </span><span class="style7">modularity</span><span class="style3">.  This allows the programmer to later change the implementation of the instance variables without affecting the functions which access objects of this class.  This in turn improves code maintainability and reusability, a goal of OOP languages.
  10411.  
  10412. Note that it is possible to modularize C programs even without TC/C++ style classes, by considering each source file to define a unique object whose instance variables have "file" scope.  More significant advantages of the TC/C++ languages are developed in the next section.
  10413.  
  10414.  
  10415.  
  10416.  
  10417.  
  10418.  
  10419. </span></text>
  10420.     </content>
  10421.     <content>
  10422.         <layer>background</layer>
  10423.         <id>7</id>
  10424.         <text>38</text>
  10425.     </content>
  10426.     <content>
  10427.         <layer>background</layer>
  10428.         <id>29</id>
  10429.         <text>40401</text>
  10430.     </content>
  10431.     <content>
  10432.         <layer>background</layer>
  10433.         <id>27</id>
  10434.         <text>public and private members</text>
  10435.     </content>
  10436.     <content>
  10437.         <layer>background</layer>
  10438.         <id>20</id>
  10439.         <text>public and private members - p141</text>
  10440.     </content>
  10441.     <content>
  10442.         <layer>background</layer>
  10443.         <id>18</id>
  10444.         <text>p207</text>
  10445.     </content>
  10446.     <name></name>
  10447.     <script></script>
  10448. </card>
  10449.  
  10450.  
  10451. card_16112.xml
  10452. <?xml version="1.0" encoding="utf-8" ?>
  10453. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10454. <card>
  10455.     <id>16112</id>
  10456.     <filler1>0</filler1>
  10457.     <cantDelete> <false /> </cantDelete>
  10458.     <showPict> <true /> </showPict>
  10459.     <dontSearch> <false /> </dontSearch>
  10460.     <owner>4755</owner>
  10461.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10462.     <content>
  10463.         <layer>background</layer>
  10464.         <id>4</id>
  10465.         <text><span class="style4">   delete person;
  10466. </span><span class="style3">
  10467. As mentioned earlier, automatic variables are allocated and deallocated automatically when the function in which they are declared is entered and exited.  This applies to the pointer variable </span><span class="style4">person</span><span class="style3">, as well.  The space used by this variable to store the address of a </span><span class="style4">Person</span><span class="style3"> object is automatically deallocated when the main function ends.
  10468.  
  10469. However, the space occupied by the object itself (space for two integers plus the "housekeeping" values used by TC) is </span><span class="style7">not</span><span class="style3"> deallocated and therefore is not reclaimed in case the program needs it later.  (Of course this is of little significance in this case since the entire program terminates when </span><span class="style4">main()</span><span class="style3"> terminates.  Later we will define objects from within functions other than </span><span class="style4">main()</span><span class="style3">, and deallocation will be relevant.)
  10470.  
  10471. Since the </span><span class="style4">new</span><span class="style3"> operator was used to dynamically allocate a Person object, it is the programmer's responsibility to deallocate this space.  This is accomplished with the </span><span class="style4">delete</span><span class="style3"> operator, whose operand should be a pointer to an object.</span></text>
  10472.     </content>
  10473.     <content>
  10474.         <layer>background</layer>
  10475.         <id>7</id>
  10476.         <text>39</text>
  10477.     </content>
  10478.     <content>
  10479.         <layer>background</layer>
  10480.         <id>18</id>
  10481.         <text>p207</text>
  10482.     </content>
  10483.     <name></name>
  10484.     <script></script>
  10485. </card>
  10486.  
  10487.  
  10488. card_16467.xml
  10489. <?xml version="1.0" encoding="utf-8" ?>
  10490. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10491. <card>
  10492.     <id>16467</id>
  10493.     <filler1>0</filler1>
  10494.     <cantDelete> <false /> </cantDelete>
  10495.     <showPict> <true /> </showPict>
  10496.     <dontSearch> <false /> </dontSearch>
  10497.     <owner>4755</owner>
  10498.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10499.     <content>
  10500.         <layer>background</layer>
  10501.         <id>4</id>
  10502.         <text><span class="style3">his completes our look at the program listed in the source file </span><span class="style18">person.c</span><span class="style3">.  We've introduced many features of C as well as the use of classes, objects, and messages provided by TC and C++.  The next section extends this example to demonstrate some of the benefits these OOP constructs provide the programmer.
  10503.  
  10504.  
  10505.  
  10506.  
  10507.  
  10508.  
  10509.  
  10510.  
  10511.  
  10512.  
  10513.  
  10514.  
  10515.  
  10516.  
  10517.  
  10518.  
  10519. </span></text>
  10520.     </content>
  10521.     <content>
  10522.         <layer>background</layer>
  10523.         <id>7</id>
  10524.         <text>40</text>
  10525.     </content>
  10526.     <content>
  10527.         <layer>background</layer>
  10528.         <id>18</id>
  10529.         <text>p207</text>
  10530.     </content>
  10531.     <name></name>
  10532.     <script></script>
  10533. </card>
  10534.  
  10535.  
  10536. card_2542.xml
  10537. <?xml version="1.0" encoding="utf-8" ?>
  10538. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10539. <card>
  10540.     <id>2542</id>
  10541.     <filler1>0</filler1>
  10542.     <cantDelete> <false /> </cantDelete>
  10543.     <showPict> <true /> </showPict>
  10544.     <dontSearch> <false /> </dontSearch>
  10545.     <owner>4755</owner>
  10546.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10547.     <content>
  10548.         <layer>background</layer>
  10549.         <id>7</id>
  10550.         <text>41</text>
  10551.     </content>
  10552.     <content>
  10553.         <layer>background</layer>
  10554.         <id>6</id>
  10555.         <text>1.2  Inheritance & Polymorphism</text>
  10556.     </content>
  10557.     <content>
  10558.         <layer>background</layer>
  10559.         <id>4</id>
  10560.         <text><span class="style3">t this point, the reader may wonder why we haven't provided an instance variable of </span><span class="style4">Person</span><span class="style3"> which is a character string, to contain a person's name.  Character strings are represented in C as arrays of </span><span class="style4">char</span><span class="style3"> variables.  For simplicity, we will postpone discussion of how C handles arrays.*  However, it should be noted that if the programmer later decides to implement such a feature in the </span><span class="style18">person.c</span><span class="style3"> program, no change will be required in the main() function.  This is one of the benefits of modular program design, where the functions using an object are "shielded" from the implementation of the object and any changes thereto.
  10561.  
  10562. Of even greater significance is the ability to derive classes from existing classes in TC and C++.  Derived classes </span><span class="style7">inherit</span><span class="style3"> the instance variables and methods of the "base" class, and may add new instance variables and methods.  New methods may be defined with the same names as those in the base class, in which case they "override" the original methods.  This property of </span><span class="style7">polymorphism</span><span class="style3"> means that the same messages can be sent to objects of different classes, with results appropriate to each.
  10563.  
  10564.  The following program listing illustrates these concepts by deriving the </span><span class="style4">Student</span><span class="style3"> class </span></text>
  10565.     </content>
  10566.     <content>
  10567.         <layer>background</layer>
  10568.         <id>27</id>
  10569.         <text>Arrays, pointers, and strings</text>
  10570.     </content>
  10571.     <content>
  10572.         <layer>background</layer>
  10573.         <id>20</id>
  10574.         <text>Arrays, pointers, and strings - p68</text>
  10575.     </content>
  10576.     <content>
  10577.         <layer>background</layer>
  10578.         <id>29</id>
  10579.         <text>22415</text>
  10580.     </content>
  10581.     <name></name>
  10582.     <script></script>
  10583. </card>
  10584.  
  10585.  
  10586. card_29918.xml
  10587. <?xml version="1.0" encoding="utf-8" ?>
  10588. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10589. <card>
  10590.     <id>29918</id>
  10591.     <filler1>0</filler1>
  10592.     <cantDelete> <false /> </cantDelete>
  10593.     <showPict> <true /> </showPict>
  10594.     <dontSearch> <false /> </dontSearch>
  10595.     <owner>4755</owner>
  10596.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10597.     <content>
  10598.         <layer>background</layer>
  10599.         <id>4</id>
  10600.         <text><span class="style3">rom the </span><span class="style4">Person</span><span class="style3"> class of the previous example.</span></text>
  10601.     </content>
  10602.     <content>
  10603.         <layer>background</layer>
  10604.         <id>7</id>
  10605.         <text>42</text>
  10606.     </content>
  10607.     <name></name>
  10608.     <script></script>
  10609. </card>
  10610.  
  10611.  
  10612. card_5118.xml
  10613. <?xml version="1.0" encoding="utf-8" ?>
  10614. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10615. <card>
  10616.     <id>5118</id>
  10617.     <filler1>0</filler1>
  10618.     <cantDelete> <false /> </cantDelete>
  10619.     <showPict> <true /> </showPict>
  10620.     <dontSearch> <false /> </dontSearch>
  10621.     <owner>4755</owner>
  10622.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10623.     <part>
  10624.         <id>6</id>
  10625.         <type>field</type>
  10626.         <visible> <true /> </visible>
  10627.         <dontWrap> <false /> </dontWrap>
  10628.         <dontSearch> <false /> </dontSearch>
  10629.         <sharedText> <false /> </sharedText>
  10630.         <fixedLineHeight> <true /> </fixedLineHeight>
  10631.         <autoTab> <false /> </autoTab>
  10632.         <lockText> <false /> </lockText>
  10633.         <rect>
  10634.             <left>30</left>
  10635.             <top>78</top>
  10636.             <right>478</right>
  10637.             <bottom>296</bottom>
  10638.         </rect>
  10639.         <style>scrolling</style>
  10640.         <autoSelect> <false /> </autoSelect>
  10641.         <showLines> <false /> </showLines>
  10642.         <wideMargins> <false /> </wideMargins>
  10643.         <multipleLines> <false /> </multipleLines>
  10644.         <reservedFamily> 0 </reservedFamily>
  10645.         <titleWidth>0</titleWidth>
  10646.         <icon>0</icon>
  10647.         <textAlign>left</textAlign>
  10648.         <font>Monaco</font>
  10649.         <textSize>9</textSize>
  10650.         <textStyle>plain</textStyle>
  10651.         <textHeight>12</textHeight>
  10652.         <name>code</name>
  10653.         <script></script>
  10654.     </part>
  10655.     <part>
  10656.         <id>7</id>
  10657.         <type>button</type>
  10658.         <visible> <true /> </visible>
  10659.         <reserved5> 0 </reserved5>
  10660.         <reserved4> 0 </reserved4>
  10661.         <reserved3> 0 </reserved3>
  10662.         <reserved2> 0 </reserved2>
  10663.         <reserved1> 0 </reserved1>
  10664.         <enabled> <true /> </enabled>
  10665.         <rect>
  10666.             <left>13</left>
  10667.             <top>29</top>
  10668.             <right>351</right>
  10669.             <bottom>57</bottom>
  10670.         </rect>
  10671.         <style>opaque</style>
  10672.         <showName> <false /> </showName>
  10673.         <highlight> <false /> </highlight>
  10674.         <autoHighlight> <false /> </autoHighlight>
  10675.         <sharedHighlight> <true /> </sharedHighlight>
  10676.         <family>0</family>
  10677.         <titleWidth>0</titleWidth>
  10678.         <icon>0</icon>
  10679.         <textAlign>center</textAlign>
  10680.         <font>Chicago</font>
  10681.         <textSize>12</textSize>
  10682.         <textStyle>plain</textStyle>
  10683.         <name>New Button</name>
  10684.         <script></script>
  10685.     </part>
  10686.     <part>
  10687.         <id>8</id>
  10688.         <type>button</type>
  10689.         <visible> <true /> </visible>
  10690.         <reserved5> 0 </reserved5>
  10691.         <reserved4> 0 </reserved4>
  10692.         <reserved3> 0 </reserved3>
  10693.         <reserved2> 0 </reserved2>
  10694.         <reserved1> 0 </reserved1>
  10695.         <enabled> <true /> </enabled>
  10696.         <rect>
  10697.             <left>169</left>
  10698.             <top>32</top>
  10699.             <right>305</right>
  10700.             <bottom>54</bottom>
  10701.         </rect>
  10702.         <style>roundrect</style>
  10703.         <showName> <true /> </showName>
  10704.         <highlight> <false /> </highlight>
  10705.         <autoHighlight> <true /> </autoHighlight>
  10706.         <sharedHighlight> <true /> </sharedHighlight>
  10707.         <family>0</family>
  10708.         <titleWidth>0</titleWidth>
  10709.         <icon>0</icon>
  10710.         <textAlign>center</textAlign>
  10711.         <font>Chicago</font>
  10712.         <textSize>12</textSize>
  10713.         <textStyle>plain</textStyle>
  10714.         <name>Copy to Clipboard</name>
  10715.         <script>on mouseUp
  10716. set lockscreen to true
  10717. select text of card field "code"
  10718. domenu "Copy Text"
  10719. select empty
  10720. set lockscreen to false
  10721. end mouseUp</script>
  10722.     </part>
  10723.     <content>
  10724.         <layer>background</layer>
  10725.         <id>7</id>
  10726.         <text>43</text>
  10727.     </content>
  10728.     <content>
  10729.         <layer>background</layer>
  10730.         <id>29</id>
  10731.         <text>
  10732. </text>
  10733.     </content>
  10734.     <content>
  10735.         <layer>card</layer>
  10736.         <id>6</id>
  10737.         <text>/*
  10738. *   FILE:    stuper.c
  10739. *   AUTHOR:  R.G.
  10740. *   CREATED: June 7, 1990
  10741. *   
  10742. *   Think C/C++ program illustrating derivation of the Student class
  10743. *   from the Person class.
  10744. *
  10745. *   PROJECT CONTENTS:
  10746. *   stuper.c, ANSI, oops libraries
  10747. */
  10748.  
  10749. # include <stdio.h>
  10750.  
  10751. /******************************************************************
  10752. *   Definition of Person class and its methods
  10753. ******************************************************************/
  10754. struct Person:indirect   // for C++ omit ":indirect"
  10755. {
  10756.     int     age;
  10757.     int     weight;
  10758.  
  10759.     virtual void    set(void);
  10760.     virtual void    print(void);
  10761. };
  10762.  
  10763. void    Person::set(void)
  10764. {
  10765.     int     new_age,
  10766.             new_weight;
  10767.  
  10768.     printf("Enter age and weight separated by spaces:\n");
  10769.     scanf("%d %d",&new_age,&new_weight);
  10770.  
  10771.     age = new_age;
  10772.     weight = new_weight;
  10773. }
  10774.  
  10775. void    Person::print(void)
  10776. {
  10777.     printf("My age is %d\n",age);
  10778.     printf("My weight is %d\n",weight);
  10779. }
  10780.  
  10781. /******************************************************************
  10782. *   Definition of new Student class and its methods
  10783. ******************************************************************/
  10784. struct Student:Person
  10785. {
  10786.     int     id_number;
  10787.  
  10788.     void    set(void);
  10789.     void    print(void);
  10790. };
  10791.  
  10792. void    Student::set(void)
  10793. {
  10794.     int     new_id;
  10795.  
  10796.     Person::set();
  10797.  
  10798.     printf("Enter student id number:\n");
  10799.     scanf("%d",&new_id);
  10800.  
  10801.     id_number = new_id;
  10802. }
  10803.  
  10804. void    Student::print(void)
  10805. {
  10806.     Person::print();
  10807.  
  10808.     printf("My id number is %d\n",id_number);
  10809. }
  10810.  
  10811. /******************************************************************
  10812. *   main() function
  10813. ******************************************************************/
  10814. main()
  10815. {
  10816.     Person  *person;
  10817.  
  10818.     person = new Student;
  10819.     person->set();
  10820.     person->print();
  10821.     delete person;
  10822. }
  10823.  
  10824. </text>
  10825.     </content>
  10826.     <content>
  10827.         <layer>background</layer>
  10828.         <id>4</id>
  10829.         <text><span class="style3"> TC/C++ program using the </span><span class="style4">Person</span><span class="style3"> and </span><span class="style4">Student</span><span class="style3"> classes:</span></text>
  10830.     </content>
  10831.     <content>
  10832.         <layer>background</layer>
  10833.         <id>6</id>
  10834.         <text>Derivation of Student class from Person class</text>
  10835.     </content>
  10836.     <name></name>
  10837.     <script></script>
  10838. </card>
  10839.  
  10840.  
  10841. card_16854.xml
  10842. <?xml version="1.0" encoding="utf-8" ?>
  10843. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10844. <card>
  10845.     <id>16854</id>
  10846.     <filler1>0</filler1>
  10847.     <cantDelete> <false /> </cantDelete>
  10848.     <showPict> <true /> </showPict>
  10849.     <dontSearch> <false /> </dontSearch>
  10850.     <owner>4755</owner>
  10851.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10852.     <content>
  10853.         <layer>background</layer>
  10854.         <id>4</id>
  10855.         <text><span class="style3">gain, you can copy this program from the scrolling text field and paste it into a new TC source file.  Sample output is shown below, with the user's responses in <> braces.
  10856.  
  10857.     Enter age and weight separated by spaces:
  10858.     <12  67>
  10859.     Enter student id number:
  10860.     <45>
  10861.     My age is 12
  10862.     My weight is 67
  10863.     My id number is 45
  10864.  
  10865. Notice that the only change to the </span><span class="style4">main()</span><span class="style3"> function is that the </span><span class="style4">person</span><span class="style3"> variable now points to a </span><span class="style4">Student</span><span class="style3"> object.
  10866. </span></text>
  10867.     </content>
  10868.     <content>
  10869.         <layer>background</layer>
  10870.         <id>7</id>
  10871.         <text>44</text>
  10872.     </content>
  10873.     <name></name>
  10874.     <script></script>
  10875. </card>
  10876.  
  10877.  
  10878. card_46824.xml
  10879. <?xml version="1.0" encoding="utf-8" ?>
  10880. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10881. <card>
  10882.     <id>46824</id>
  10883.     <filler1>0</filler1>
  10884.     <cantDelete> <false /> </cantDelete>
  10885.     <showPict> <true /> </showPict>
  10886.     <dontSearch> <false /> </dontSearch>
  10887.     <owner>4755</owner>
  10888.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10889.     <content>
  10890.         <layer>background</layer>
  10891.         <id>4</id>
  10892.         <text><span class="style4">   virtual void    set(void);
  10893.     virtual void    print(void);
  10894.  
  10895. </span><span class="style3">Only one minor change has been made to the definition of the </span><span class="style4">Person</span><span class="style3"> class.*  The method declarations have been preceded by the </span><span class="style4">virtual</span><span class="style3"> keyword.  For now we will assume that all methods will be declared as </span><span class="style4">virtual</span><span class="style3">.</span><span class="style4">
  10896.  
  10897.  
  10898.  
  10899.  
  10900.  
  10901.  
  10902.  
  10903.  
  10904.  
  10905.  
  10906.  
  10907.  
  10908. </span></text>
  10909.     </content>
  10910.     <content>
  10911.         <layer>background</layer>
  10912.         <id>29</id>
  10913.         <text>12751</text>
  10914.     </content>
  10915.     <content>
  10916.         <layer>background</layer>
  10917.         <id>27</id>
  10918.         <text>Person definition</text>
  10919.     </content>
  10920.     <content>
  10921.         <layer>background</layer>
  10922.         <id>20</id>
  10923.         <text>Person definition - p23</text>
  10924.     </content>
  10925.     <content>
  10926.         <layer>background</layer>
  10927.         <id>7</id>
  10928.         <text>45</text>
  10929.     </content>
  10930.     <name></name>
  10931.     <script></script>
  10932. </card>
  10933.  
  10934.  
  10935. card_15831.xml
  10936. <?xml version="1.0" encoding="utf-8" ?>
  10937. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10938. <card>
  10939.     <id>15831</id>
  10940.     <filler1>0</filler1>
  10941.     <cantDelete> <false /> </cantDelete>
  10942.     <showPict> <true /> </showPict>
  10943.     <dontSearch> <false /> </dontSearch>
  10944.     <owner>4755</owner>
  10945.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10946.     <content>
  10947.         <layer>background</layer>
  10948.         <id>4</id>
  10949.         <text><span class="style4">   struct Student:Person
  10950. </span><span class="style3">
  10951. A new class has been defined, called </span><span class="style4">Student</span><span class="style3">.  The notation </span><span class="style4">Student:Person</span><span class="style3"> here indicates that the new class is </span><span class="style7">derived</span><span class="style3"> from the </span><span class="style4">Person</span><span class="style3"> class.  (Since the </span><span class="style4">Person</span><span class="style3"> class was itself defined with the </span><span class="style4">indirect</span><span class="style3"> specifier, the derived class is also </span><span class="style4">indirect</span><span class="style3">.)
  10952.  
  10953. A derived class ("child", "descendant", "subclass") is one which inherits the instance variables and methods of its base class ("parent", "ancestor").  In this case, any object of type </span><span class="style4">Student</span><span class="style3"> will contain </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables even if no such variables are explicitly declared in the definition of the </span><span class="style4">Student</span><span class="style3"> class.  They are inherited from the </span><span class="style4">Person</span><span class="style3"> class.
  10954.  
  10955. Likewise, if no </span><span class="style4">set()</span><span class="style3"> or </span><span class="style4">print()</span><span class="style3"> methods are defined in the </span><span class="style4">Student</span><span class="style3"> class definition, a </span><span class="style4">Student</span><span class="style3"> object will still accept </span><span class="style4">set</span><span class="style3"> and </span><span class="style4">print</span><span class="style3"> messages by accessing the methods defined for the </span><span class="style4">Person</span><span class="style3"> class.</span></text>
  10956.     </content>
  10957.     <content>
  10958.         <layer>background</layer>
  10959.         <id>7</id>
  10960.         <text>46</text>
  10961.     </content>
  10962.     <content>
  10963.         <layer>background</layer>
  10964.         <id>17</id>
  10965.         <text>p202</text>
  10966.     </content>
  10967.     <name></name>
  10968.     <script></script>
  10969. </card>
  10970.  
  10971.  
  10972. card_19767.xml
  10973. <?xml version="1.0" encoding="utf-8" ?>
  10974. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  10975. <card>
  10976.     <id>19767</id>
  10977.     <filler1>0</filler1>
  10978.     <cantDelete> <false /> </cantDelete>
  10979.     <showPict> <true /> </showPict>
  10980.     <dontSearch> <false /> </dontSearch>
  10981.     <owner>4755</owner>
  10982.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  10983.     <content>
  10984.         <layer>background</layer>
  10985.         <id>4</id>
  10986.         <text>As will be seen in Chapter 4, separate source files are often used for the definitions of each class.  In this way there is no need to recompile the base class method definitions when a new class is derived from it.</text>
  10987.     </content>
  10988.     <content>
  10989.         <layer>background</layer>
  10990.         <id>7</id>
  10991.         <text>47</text>
  10992.     </content>
  10993.     <content>
  10994.         <layer>background</layer>
  10995.         <id>17</id>
  10996.         <text>p123</text>
  10997.     </content>
  10998.     <content>
  10999.         <layer>background</layer>
  11000.         <id>18</id>
  11001.         <text>p116</text>
  11002.     </content>
  11003.     <name></name>
  11004.     <script></script>
  11005. </card>
  11006.  
  11007.  
  11008. card_17427.xml
  11009. <?xml version="1.0" encoding="utf-8" ?>
  11010. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11011. <card>
  11012.     <id>17427</id>
  11013.     <filler1>0</filler1>
  11014.     <cantDelete> <false /> </cantDelete>
  11015.     <showPict> <true /> </showPict>
  11016.     <dontSearch> <false /> </dontSearch>
  11017.     <owner>4755</owner>
  11018.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11019.     <content>
  11020.         <layer>background</layer>
  11021.         <id>4</id>
  11022.         <text><span class="style4">   int     id_number;
  11023.  
  11024.     void    set(void);
  11025.     void    print(void);
  11026. </span><span class="style3">
  11027. The </span><span class="style4">Student</span><span class="style3"> class contains one additional instance variable, the </span><span class="style4">id_number</span><span class="style3">.  Again, since </span><span class="style4">Student</span><span class="style3"> is derived from </span><span class="style4">Person</span><span class="style3">, </span><span class="style4">Student</span><span class="style3"> objects will have </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables without need to redeclare them here.
  11028.  
  11029. Since the </span><span class="style4">set()</span><span class="style3"> and </span><span class="style4">print()</span><span class="style3"> methods are redeclared in the </span><span class="style4">Student</span><span class="style3"> definition, they "override" the </span><span class="style4">Person</span><span class="style3">'s definition of these methods, and will require new definitions.  Since these methods were declared </span><span class="style4">virtual</span><span class="style3"> in the </span><span class="style4">Parent</span><span class="style3"> base class, it is not necessary to use the </span><span class="style4">virtual</span><span class="style3"> keyword here.
  11030.  
  11031. If these declarations had been ommitted, then objects of type </span><span class="style4">Student</span><span class="style3"> would still accept </span><span class="style4">set</span><span class="style3"> and </span><span class="style4">print</span><span class="style3"> messages but would use the definitions for these functions provided for the </span><span class="style4">Person</span><span class="style3"> class.</span></text>
  11032.     </content>
  11033.     <content>
  11034.         <layer>background</layer>
  11035.         <id>7</id>
  11036.         <text>48</text>
  11037.     </content>
  11038.     <content>
  11039.         <layer>background</layer>
  11040.         <id>17</id>
  11041.         <text>p142</text>
  11042.     </content>
  11043.     <name></name>
  11044.     <script></script>
  11045. </card>
  11046.  
  11047.  
  11048. card_18573.xml
  11049. <?xml version="1.0" encoding="utf-8" ?>
  11050. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11051. <card>
  11052.     <id>18573</id>
  11053.     <filler1>0</filler1>
  11054.     <cantDelete> <false /> </cantDelete>
  11055.     <showPict> <true /> </showPict>
  11056.     <dontSearch> <false /> </dontSearch>
  11057.     <owner>4755</owner>
  11058.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11059.     <content>
  11060.         <layer>background</layer>
  11061.         <id>4</id>
  11062.         <text><span class="style4">   void    Student::set(void)
  11063. </span><span class="style3">
  11064. Notice that the overriding method must have the same type of arguments and return value as the original method, if the original method was declared </span><span class="style4">virtual</span><span class="style3">.
  11065.  
  11066. The </span><span class="style4">Student</span><span class="style3"> </span><span class="style4">set()</span><span class="style3"> method definition assigns the </span><span class="style4">id_number</span><span class="style3"> instance variable using the same approach as was used by the </span><span class="style4">Person</span><span class="style3"> </span><span class="style4">set()</span><span class="style3"> method to assign its instance variables.  We could have assigned new values to the inherited </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables in the same way.  Instead we took the approach shown on the following page.</span></text>
  11067.     </content>
  11068.     <content>
  11069.         <layer>background</layer>
  11070.         <id>7</id>
  11071.         <text>49</text>
  11072.     </content>
  11073.     <content>
  11074.         <layer>background</layer>
  11075.         <id>17</id>
  11076.         <text>p153</text>
  11077.     </content>
  11078.     <name></name>
  11079.     <script></script>
  11080. </card>
  11081.  
  11082.  
  11083. card_18743.xml
  11084. <?xml version="1.0" encoding="utf-8" ?>
  11085. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11086. <card>
  11087.     <id>18743</id>
  11088.     <filler1>0</filler1>
  11089.     <cantDelete> <false /> </cantDelete>
  11090.     <showPict> <true /> </showPict>
  11091.     <dontSearch> <false /> </dontSearch>
  11092.     <owner>4755</owner>
  11093.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11094.     <content>
  11095.         <layer>background</layer>
  11096.         <id>4</id>
  11097.         <text><span class="style4">   Person::set();
  11098. </span><span class="style3">
  11099. This syntax calls the </span><span class="style4">set()</span><span class="style3"> method of the </span><span class="style4">Person</span><span class="style3"> base class.  When a </span><span class="style4">set</span><span class="style3"> message is sent to an object of type </span><span class="style4">Student</span><span class="style3">, the </span><span class="style4">id_number</span><span class="style3"> instance variable is assigned, and the </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables are assigned according to the </span><span class="style4">set()</span><span class="style3"> method of the </span><span class="style4">Person</span><span class="style3"> class.  A similar approach is used in </span><span class="style4">Student::print()</span><span class="style3">
  11100.  
  11101. The advantage of this approach is that future changes in the implementation of the </span><span class="style4">Person</span><span class="style3"> class will not require changes to the </span><span class="style4">Student</span><span class="style3"> class methods.  For example, if a new </span><span class="style4">name</span><span class="style3"> instance variable is added to the </span><span class="style4">Person</span><span class="style3"> class, and this variable is assigned a value in </span><span class="style4">Person::set()</span><span class="style3">, then the </span><span class="style4">Student</span><span class="style3"> class will immediately inherit the new functionality.
  11102.  
  11103. In TC another approach available, and the programmer may instead use:
  11104.  
  11105. </span><span class="style4">    inherited::set();
  11106. </span></text>
  11107.     </content>
  11108.     <content>
  11109.         <layer>background</layer>
  11110.         <id>7</id>
  11111.         <text>50</text>
  11112.     </content>
  11113.     <content>
  11114.         <layer>background</layer>
  11115.         <id>18</id>
  11116.         <text>p207</text>
  11117.     </content>
  11118.     <name></name>
  11119.     <script></script>
  11120. </card>
  11121.  
  11122.  
  11123. card_19119.xml
  11124. <?xml version="1.0" encoding="utf-8" ?>
  11125. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11126. <card>
  11127.     <id>19119</id>
  11128.     <filler1>0</filler1>
  11129.     <cantDelete> <false /> </cantDelete>
  11130.     <showPict> <true /> </showPict>
  11131.     <dontSearch> <false /> </dontSearch>
  11132.     <owner>4755</owner>
  11133.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11134.     <content>
  11135.         <layer>background</layer>
  11136.         <id>4</id>
  11137.         <text><span class="style4">   Person  *person;
  11138.  
  11139.     person = new Student;
  11140. </span><span class="style3">
  11141. The sole change to the </span><span class="style4">main()</span><span class="style3"> function is the use of </span><span class="style4">new</span><span class="style3"> to create a </span><span class="style4">Student</span><span class="style3"> object instead of a </span><span class="style4">Person</span><span class="style3"> object.  Notice that </span><span class="style4">person</span><span class="style3"> is still declared as a pointer to a </span><span class="style4">Person</span><span class="style3"> object.  It is legal to assign a pointer of one class to a pointer declared to have another class, as long as the latter class is an </span><span class="style7">ancestor</span><span class="style3"> of the former.
  11142.  
  11143. When a </span><span class="style4">set</span><span class="style3"> or </span><span class="style4">print</span><span class="style3"> message is sent to the object pointed to by </span><span class="style4">person</span><span class="style3">, TC/C++ determines the class of this object and invokes the appropriate method.  In this case, it is the </span><span class="style4">set()</span><span class="style3"> or </span><span class="style4">print()</span><span class="style3"> method of the </span><span class="style4">Student</span><span class="style3"> class which is invoked.
  11144.  
  11145. If these methods had </span><span class="style7">not</span><span class="style3"> been declared </span><span class="style4">virtual</span><span class="style3"> then the </span><span class="style4">Person</span><span class="style3"> methods would have instead been invoked.  That is, the non-virtual method invoked depends on the type used to declare the </span><span class="style4">person</span><span class="style3"> pointer, rather than the type created at run-time. 
  11146.  
  11147. </span></text>
  11148.     </content>
  11149.     <content>
  11150.         <layer>background</layer>
  11151.         <id>7</id>
  11152.         <text>51</text>
  11153.     </content>
  11154.     <content>
  11155.         <layer>background</layer>
  11156.         <id>17</id>
  11157.         <text>p142</text>
  11158.     </content>
  11159.     <name></name>
  11160.     <script></script>
  11161. </card>
  11162.  
  11163.  
  11164. card_63974.xml
  11165. <?xml version="1.0" encoding="utf-8" ?>
  11166. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11167. <card>
  11168.     <id>63974</id>
  11169.     <filler1>0</filler1>
  11170.     <cantDelete> <false /> </cantDelete>
  11171.     <showPict> <true /> </showPict>
  11172.     <dontSearch> <false /> </dontSearch>
  11173.     <owner>4755</owner>
  11174.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11175.     <content>
  11176.         <layer>background</layer>
  11177.         <id>4</id>
  11178.         <text><span class="style3">ater we will declare an array of </span><span class="style4">Person</span><span class="style3"> pointers, assign objects of various derived classes to these pointers, and make use of the polymorphism property of their virtual methods.</span></text>
  11179.     </content>
  11180.     <content>
  11181.         <layer>background</layer>
  11182.         <id>7</id>
  11183.         <text>52</text>
  11184.     </content>
  11185.     <name></name>
  11186.     <script></script>
  11187. </card>
  11188.  
  11189.  
  11190. card_19225.xml
  11191. <?xml version="1.0" encoding="utf-8" ?>
  11192. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11193. <card>
  11194.     <id>19225</id>
  11195.     <filler1>0</filler1>
  11196.     <cantDelete> <false /> </cantDelete>
  11197.     <showPict> <true /> </showPict>
  11198.     <dontSearch> <false /> </dontSearch>
  11199.     <owner>4755</owner>
  11200.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11201.     <content>
  11202.         <layer>background</layer>
  11203.         <id>4</id>
  11204.         <text>In the previous sections we saw how modularizing a program according to the classes of its objects helps improve understanding and simplifies maintenance.  Further, we saw how a derived class inherits the members of the original class, and how polymorphism allows the same messages to be sent to objects of either class.
  11205.  
  11206. The benefits of these OOP qualities to software engineering efforts should not be underestimated.  If a change needs to be made to a piece of software in order to accomodate changing requirements, the traditional approach is to modify the original source code.  This often requires the programmer to have a detailed understanding of the original functions and data structures.
  11207.  
  11208. In contrast, software designed with an OOP language like TC/C++ should require very few modifications of the original code in the new situation.  The programmer instead defines new classes derived from the original classes, with the required additional functionality.  The programmer is required to understand the sorts of messages the original objects responded to, not the implementation of the objects.
  11209.  
  11210. </text>
  11211.     </content>
  11212.     <content>
  11213.         <layer>background</layer>
  11214.         <id>7</id>
  11215.         <text>53</text>
  11216.     </content>
  11217.     <content>
  11218.         <layer>background</layer>
  11219.         <id>6</id>
  11220.         <text>1.3  OOP Benefits</text>
  11221.     </content>
  11222.     <content>
  11223.         <layer>background</layer>
  11224.         <id>17</id>
  11225.         <text>p66</text>
  11226.     </content>
  11227.     <name></name>
  11228.     <script></script>
  11229. </card>
  11230.  
  11231.  
  11232. card_19698.xml
  11233. <?xml version="1.0" encoding="utf-8" ?>
  11234. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11235. <card>
  11236.     <id>19698</id>
  11237.     <filler1>0</filler1>
  11238.     <cantDelete> <false /> </cantDelete>
  11239.     <showPict> <true /> </showPict>
  11240.     <dontSearch> <false /> </dontSearch>
  11241.     <owner>4755</owner>
  11242.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11243.     <content>
  11244.         <layer>background</layer>
  11245.         <id>4</id>
  11246.         <text>This encourages the reuse of classes in new programming efforts, reducing duplication of effort and speeding development.  As software engineering efforts become more and more complex (due in part to the demand for improved user interfaces and improved portability), OOP languages become indispensible to the programmer wishing to remain competitive. </text>
  11247.     </content>
  11248.     <content>
  11249.         <layer>background</layer>
  11250.         <id>7</id>
  11251.         <text>54</text>
  11252.     </content>
  11253.     <content>
  11254.         <layer>background</layer>
  11255.         <id>17</id>
  11256.         <text>p226</text>
  11257.     </content>
  11258.     <name></name>
  11259.     <script></script>
  11260. </card>
  11261.  
  11262.  
  11263. card_6753.xml
  11264. <?xml version="1.0" encoding="utf-8" ?>
  11265. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11266. <card>
  11267.     <id>6753</id>
  11268.     <filler1>0</filler1>
  11269.     <cantDelete> <false /> </cantDelete>
  11270.     <showPict> <true /> </showPict>
  11271.     <dontSearch> <false /> </dontSearch>
  11272.     <owner>4755</owner>
  11273.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11274.     <content>
  11275.         <layer>background</layer>
  11276.         <id>7</id>
  11277.         <text>55</text>
  11278.     </content>
  11279.     <content>
  11280.         <layer>background</layer>
  11281.         <id>6</id>
  11282.         <text>2.  Data Types</text>
  11283.     </content>
  11284.     <content>
  11285.         <layer>background</layer>
  11286.         <id>4</id>
  11287.         <text><span class="style3">he C language was designed with a simple and minimal set of "built-in" data types, operators, and statements.  However, C provides powerful tools to extend these facilities with user-defined data types, functions, and other constructs.  In fact, C is commonly augmented with "libraries" of these facilities.
  11288.  
  11289. With the advent of Think C and C++, groups of data types and functions may be packaged together as </span><span class="style7">classes</span><span class="style3">, which will be discussed in Chapter 4.  This new tool encourages further augmentation of C via class libraries.
  11290.  
  11291. This chapter will describe the use of the pre-defined data types available in C, user-defined data types, and arrays of these data types.
  11292. </span></text>
  11293.     </content>
  11294.     <name></name>
  11295.     <script></script>
  11296. </card>
  11297.  
  11298.  
  11299. card_22558.xml
  11300. <?xml version="1.0" encoding="utf-8" ?>
  11301. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11302. <card>
  11303.     <id>22558</id>
  11304.     <filler1>0</filler1>
  11305.     <cantDelete> <false /> </cantDelete>
  11306.     <showPict> <true /> </showPict>
  11307.     <dontSearch> <false /> </dontSearch>
  11308.     <owner>4755</owner>
  11309.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11310.     <content>
  11311.         <layer>background</layer>
  11312.         <id>6</id>
  11313.         <text>2.1  Basic Types</text>
  11314.     </content>
  11315.     <content>
  11316.         <layer>background</layer>
  11317.         <id>7</id>
  11318.         <text>56</text>
  11319.     </content>
  11320.     <content>
  11321.         <layer>background</layer>
  11322.         <id>4</id>
  11323.         <text><span class="style3">nly 3 basic data types are available in C:  </span><span class="style7">integers</span><span class="style3">, </span><span class="style7">characters</span><span class="style3">, and </span><span class="style7">floating point (real) numbers</span><span class="style3">.  These types may be further specified according to the size or accuracy desired.  Both </span><span class="style7">variables</span><span class="style3"> and </span><span class="style7">constants</span><span class="style3"> of these types may be defined.
  11324.  
  11325. The </span><span class="style7">identifier</span><span class="style3"> for a C variable ‚Äî like that for a function ‚Äî is any non-reserved sequence of letters (case is significant!), digits, and underscore (_) characters, with the restriction that the first character cannot be a digit and in general should not be an underscore.  There is no restriction to the length of an identifier, although ANSI C compilers may ignore characters beyond the 31st.  Commonly multi-word identifiers are described by using underscores (average_of_grades) to separate words or by beginning each new word with a capital letter (averageOfGrades).  It is customary never to begin a variable identifier with a capital letter.
  11326.  
  11327. </span></text>
  11328.     </content>
  11329.     <name></name>
  11330.     <script></script>
  11331. </card>
  11332.  
  11333.  
  11334. card_23387.xml
  11335. <?xml version="1.0" encoding="utf-8" ?>
  11336. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11337. <card>
  11338.     <id>23387</id>
  11339.     <filler1>0</filler1>
  11340.     <cantDelete> <false /> </cantDelete>
  11341.     <showPict> <true /> </showPict>
  11342.     <dontSearch> <false /> </dontSearch>
  11343.     <owner>4755</owner>
  11344.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11345.     <content>
  11346.         <layer>background</layer>
  11347.         <id>4</id>
  11348.         <text><span class="style3">NTEGERS
  11349.  
  11350. Variables are declared by giving the </span><span class="style7">type specifier</span><span class="style3"> followed by the identifier.  A statement declaring </span><span class="style4">average</span><span class="style3"> to identify an integer variable is:
  11351. </span><span class="style8">
  11352. </span><span class="style4">    int    average;
  11353. </span><span class="style8">
  11354. </span><span class="style3">The </span><span class="style7">size</span><span class="style3"> of an integer is machine-dependent.  The </span><span class="style4">int</span><span class="style3"> type specifier may be preceded or replaced by the keywords:  </span><span class="style4">short</span><span class="style3">, </span><span class="style4">long</span><span class="style3">, or </span><span class="style4">unsigned</span><span class="style3">, to alter the storage.  In TC, short ints and ints both occupy 16 bits (there's an option for 32 bit ints) and long ints occupy 32 bits.  An unsigned int allows all 16 bits to be used for the magnitude of the number, allowing numbers from 0 to 65,535 (rather than plus or minus 32,767).
  11355.  
  11356. Integer constants are expressed as a sequence of digits with optional minus sign.  A letter 'L' may be appended to indicate a long int constant: 
  11357. </span><span class="style4">
  11358.     long    final_sum;
  11359.     final_sum = 32768L;
  11360. </span></text>
  11361.     </content>
  11362.     <content>
  11363.         <layer>background</layer>
  11364.         <id>7</id>
  11365.         <text>57</text>
  11366.     </content>
  11367.     <name></name>
  11368.     <script></script>
  11369. </card>
  11370.  
  11371.  
  11372. card_46372.xml
  11373. <?xml version="1.0" encoding="utf-8" ?>
  11374. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11375. <card>
  11376.     <id>46372</id>
  11377.     <filler1>0</filler1>
  11378.     <cantDelete> <false /> </cantDelete>
  11379.     <showPict> <true /> </showPict>
  11380.     <dontSearch> <false /> </dontSearch>
  11381.     <owner>4755</owner>
  11382.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11383.     <content>
  11384.         <layer>background</layer>
  11385.         <id>4</id>
  11386.         <text><span class="style3">his last statement demonstrates the C </span><span class="style7">assignment</span><span class="style3"> operator </span><span class="style4">=</span><span class="style3">.  This operator assigns the value of its rightmost operand to the leftmost operand.  Since </span><span class="style4">=</span><span class="style3"> is an operator, however, the assignment expression has a value of its own: </span><span class="style7">the value which was assigned</span><span class="style3">.  Therefore in the following example the value of "</span><span class="style4">(a=6)</span><span class="style3">" is 6, so the value 12 is assigned to the integer variable </span><span class="style4">b</span><span class="style3">:
  11387. </span><span class="style4">
  11388.     int    a;
  11389.     int    b;
  11390.     b = 2 * (a=6);
  11391.  
  11392. </span><span class="style3">In this example the variable </span><span class="style4">a</span><span class="style3"> is assigned the value 6 as a "side effect" of evaluating the expression "</span><span class="style4">2 * (a=6)</span><span class="style3">".</span></text>
  11393.     </content>
  11394.     <content>
  11395.         <layer>background</layer>
  11396.         <id>7</id>
  11397.         <text>58</text>
  11398.     </content>
  11399.     <name></name>
  11400.     <script></script>
  11401. </card>
  11402.  
  11403.  
  11404. card_23578.xml
  11405. <?xml version="1.0" encoding="utf-8" ?>
  11406. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11407. <card>
  11408.     <id>23578</id>
  11409.     <filler1>0</filler1>
  11410.     <cantDelete> <false /> </cantDelete>
  11411.     <showPict> <true /> </showPict>
  11412.     <dontSearch> <false /> </dontSearch>
  11413.     <owner>4755</owner>
  11414.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11415.     <content>
  11416.         <layer>background</layer>
  11417.         <id>4</id>
  11418.         <text><span class="style3">LOATING-POINT NUMBERS
  11419.  
  11420. Floating-point variables are declared using the </span><span class="style4">float</span><span class="style3"> type specifier, and floating point constants are indicated by a decimal point:
  11421. </span><span class="style4">
  11422.     float    standard_deviation = 0.;
  11423.  
  11424. </span><span class="style3">Notice that an initial value may optionally be given in a declaration.  In the absence of initialization, the variable will initially contain an unknown "garbage" value.
  11425.  
  11426. Double-precision floating-point variables use the </span><span class="style4">double</span><span class="style3"> specifier, usually occuping 64 bits instead of a float's 32 bits.  Floating-point constants are double by default.  In Think C, arithmetic using doubles is faster that that using float variables.  
  11427.  
  11428. An alternate representation of floating-point constants uses "e" notation to indicate the number is to be multiplied by 10 raised to the indicated exponent:
  11429. </span><span class="style4">
  11430.     standard_deviation = 1e-4;     //  same as .0001  
  11431.  
  11432.  
  11433.  
  11434.  
  11435.  
  11436. </span></text>
  11437.     </content>
  11438.     <content>
  11439.         <layer>background</layer>
  11440.         <id>7</id>
  11441.         <text>59</text>
  11442.     </content>
  11443.     <name></name>
  11444.     <script></script>
  11445. </card>
  11446.  
  11447.  
  11448. card_24002.xml
  11449. <?xml version="1.0" encoding="utf-8" ?>
  11450. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11451. <card>
  11452.     <id>24002</id>
  11453.     <filler1>0</filler1>
  11454.     <cantDelete> <false /> </cantDelete>
  11455.     <showPict> <true /> </showPict>
  11456.     <dontSearch> <false /> </dontSearch>
  11457.     <owner>4755</owner>
  11458.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11459.     <content>
  11460.         <layer>background</layer>
  11461.         <id>4</id>
  11462.         <text><span class="style3">HARACTERS
  11463.  
  11464. Character variables are declared using the </span><span class="style4">char</span><span class="style3"> specifier, and may take on any single value in the machine's </span><span class="style7">character set</span><span class="style3">.  An integer representation is used corresponding to this character set.  Character constants may be identified by either the appropriate integer or by the character enclosed in single quotes:
  11465. </span><span class="style4">
  11466.     char    input1, input2;
  11467.     input1 = 'a';
  11468.     input2 = 97;
  11469.  
  11470. </span><span class="style3">(In machines using the ASCII character set, both </span><span class="style4">input1</span><span class="style3"> and </span><span class="style4">input2</span><span class="style3"> will represent the same value.  In general, the first assignment is preferable since it is clearer and not machine-dependent.)
  11471.  
  11472. Non-printable characters in the character set are represented by an escape sequence:  a backslash followed by a code character.  For example, the carriage return character is represented by '</span><span class="style4">\n</span><span class="style3">'.</span></text>
  11473.     </content>
  11474.     <content>
  11475.         <layer>background</layer>
  11476.         <id>7</id>
  11477.         <text>60</text>
  11478.     </content>
  11479.     <name></name>
  11480.     <script></script>
  11481. </card>
  11482.  
  11483.  
  11484. card_24134.xml
  11485. <?xml version="1.0" encoding="utf-8" ?>
  11486. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11487. <card>
  11488.     <id>24134</id>
  11489.     <filler1>0</filler1>
  11490.     <cantDelete> <false /> </cantDelete>
  11491.     <showPict> <true /> </showPict>
  11492.     <dontSearch> <false /> </dontSearch>
  11493.     <owner>4755</owner>
  11494.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11495.     <content>
  11496.         <layer>background</layer>
  11497.         <id>4</id>
  11498.         <text><span class="style3">s suggested by the integer representation of characters, characters and integers may be (carefully!) mixed in expressions to accomplish certain tasks:
  11499. </span><span class="style4">
  11500.     int     i;
  11501.     char    c;
  11502.     i = 12;
  11503.     c = 'a' + i - 1;
  11504.  
  11505. </span><span class="style3">The above assigns</span><span class="style4"> c</span><span class="style3"> the character which occupies the (</span><span class="style4">i-1</span><span class="style3">)th position after the character </span><span class="style4">a</span><span class="style3"> in the machine's character set.  In most character sets, and assuming </span><span class="style4">i</span><span class="style3"> is no greater than 26, </span><span class="style4">c</span><span class="style3"> will then represent the ith letter of the alphabet.
  11506.  
  11507. Character </span><span class="style7">strings</span><span class="style3"> are represented as arrays of characters in C.  This will be discussed later in this chapter.</span></text>
  11508.     </content>
  11509.     <content>
  11510.         <layer>background</layer>
  11511.         <id>7</id>
  11512.         <text>61</text>
  11513.     </content>
  11514.     <name></name>
  11515.     <script></script>
  11516. </card>
  11517.  
  11518.  
  11519. card_70575.xml
  11520. <?xml version="1.0" encoding="utf-8" ?>
  11521. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11522. <card>
  11523.     <id>70575</id>
  11524.     <filler1>0</filler1>
  11525.     <cantDelete> <false /> </cantDelete>
  11526.     <showPict> <true /> </showPict>
  11527.     <dontSearch> <false /> </dontSearch>
  11528.     <owner>4755</owner>
  11529.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11530.     <content>
  11531.         <layer>background</layer>
  11532.         <id>4</id>
  11533.         <text><span class="style3">ONST AND VOLATILE
  11534.  
  11535. The </span><span class="style4">const</span><span class="style3"> qualifier indicates that a "variable" may not be modified.  If an identifier is declared using the </span><span class="style4">const</span><span class="style3"> qualifier, an initial value must be given, and this value may not be changed subsequently.  One use of this qualifier is to declare a symbolic constant:
  11536. </span><span class="style4">
  11537.     const float  pi = 3.14159;
  11538.         .
  11539.         .
  11540.     pi = pi/2.;       // disallowed since pi is constant
  11541.  
  11542. </span><span class="style3">Previous to the advent of </span><span class="style4">const</span><span class="style3">, symbolic constants were defined using the C preprocessor.*
  11543.  
  11544. Less frequently used, the </span><span class="style4">volatile</span><span class="style3"> qualifier indicates that a value may change without any action on the part of the program, perhaps via intervention by the operating system.  When a variable is declared </span><span class="style4">volatile</span><span class="style3">, the compiler disallows the </span></text>
  11545.     </content>
  11546.     <content>
  11547.         <layer>background</layer>
  11548.         <id>29</id>
  11549.         <text>51878</text>
  11550.     </content>
  11551.     <content>
  11552.         <layer>background</layer>
  11553.         <id>27</id>
  11554.         <text>Macro substitution</text>
  11555.     </content>
  11556.     <content>
  11557.         <layer>background</layer>
  11558.         <id>20</id>
  11559.         <text>Macro substitution - p192</text>
  11560.     </content>
  11561.     <content>
  11562.         <layer>background</layer>
  11563.         <id>7</id>
  11564.         <text>62</text>
  11565.     </content>
  11566.     <name></name>
  11567.     <script></script>
  11568. </card>
  11569.  
  11570.  
  11571. card_73425.xml
  11572. <?xml version="1.0" encoding="utf-8" ?>
  11573. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11574. <card>
  11575.     <id>73425</id>
  11576.     <filler1>0</filler1>
  11577.     <cantDelete> <false /> </cantDelete>
  11578.     <showPict> <true /> </showPict>
  11579.     <dontSearch> <false /> </dontSearch>
  11580.     <owner>4755</owner>
  11581.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11582.     <content>
  11583.         <layer>background</layer>
  11584.         <id>4</id>
  11585.         <text>program from storing the value of the variable elsewhere and making use of this stored value (since it may be out of date).</text>
  11586.     </content>
  11587.     <content>
  11588.         <layer>background</layer>
  11589.         <id>7</id>
  11590.         <text>63</text>
  11591.     </content>
  11592.     <name></name>
  11593.     <script></script>
  11594. </card>
  11595.  
  11596.  
  11597. card_20555.xml
  11598. <?xml version="1.0" encoding="utf-8" ?>
  11599. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11600. <card>
  11601.     <id>20555</id>
  11602.     <filler1>0</filler1>
  11603.     <cantDelete> <false /> </cantDelete>
  11604.     <showPict> <true /> </showPict>
  11605.     <dontSearch> <false /> </dontSearch>
  11606.     <owner>4755</owner>
  11607.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11608.     <content>
  11609.         <layer>background</layer>
  11610.         <id>7</id>
  11611.         <text>64</text>
  11612.     </content>
  11613.     <content>
  11614.         <layer>background</layer>
  11615.         <id>6</id>
  11616.         <text>2.2  Pointers</text>
  11617.     </content>
  11618.     <content>
  11619.         <layer>background</layer>
  11620.         <id>4</id>
  11621.         <text><span class="style3">he value of a </span><span class="style7">pointer</span><span class="style3"> variable is the </span><span class="style7">address</span><span class="style3"> of a value of another type.  In this case, the type of value contained at this address must be stated.  The </span><span class="style4">*</span><span class="style3"> qualifier used here declares the variable </span><span class="style4">f_ptr</span><span class="style3"> to be a pointer to a floating-point value:
  11622. </span><span class="style4">
  11623.     float    *f_ptr;
  11624.  
  11625. </span><span class="style3">Whenever a pointer variable is used, a non-pointer value must be declared as well, in order to allocate machine addresses to contain the data to be pointed to.  Two operators are commonly used in expressions involving pointers:  </span><span class="style4">&</span><span class="style3"> ("address of") and </span><span class="style4">*</span><span class="style3"> ("that which is pointed to by").
  11626. </span><span class="style4">
  11627.     float    amplitude = 100.;
  11628.     float    *f_ptr;
  11629.     f_ptr = &amplitude;
  11630.     amplitude = *f_ptr/2.;
  11631.  
  11632. </span><span class="style3">These statements declare a pointer </span><span class="style4">f_ptr</span><span class="style3"> to a float, as well as a float </span><span class="style4">amplitude</span><span class="style3"> which is initialized here to 100.
  11633.  
  11634.  
  11635. </span></text>
  11636.     </content>
  11637.     <name></name>
  11638.     <script></script>
  11639. </card>
  11640.  
  11641.  
  11642. card_24451.xml
  11643. <?xml version="1.0" encoding="utf-8" ?>
  11644. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11645. <card>
  11646.     <id>24451</id>
  11647.     <filler1>0</filler1>
  11648.     <cantDelete> <false /> </cantDelete>
  11649.     <showPict> <true /> </showPict>
  11650.     <dontSearch> <false /> </dontSearch>
  11651.     <owner>4755</owner>
  11652.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11653.     <content>
  11654.         <layer>background</layer>
  11655.         <id>4</id>
  11656.         <text><span class="style3">The address of" the variable </span><span class="style4">amplitude</span><span class="style3"> is assigned to </span><span class="style4">f_ptr</span><span class="style3">.  Finally, "that which is pointed to by" </span><span class="style4">f_ptr</span><span class="style3"> (namely the value represented by </span><span class="style4">amplitude</span><span class="style3">) is halved and assigned back to </span><span class="style4">amplitude</span><span class="style3">.
  11657.  
  11658. Pointers are used frequently in C, mainly for two purposes:  informing a function of the location of data to be accessed and traversing arrays efficiently.  (Note that the former purpose essentially extends the scope* of the data.  Abuse of this may produce code which is difficult to understand and to maintain.)
  11659.  
  11660. A special pointer, the </span><span class="style7">void pointer</span><span class="style3"> will be useful later in this document.  The </span><span class="style4">void</span><span class="style3"> data type is used mostly to declare the return value of functions whose return value is to be ignored.  Variables cannot be declared to have this type.  However, variables which are void pointers may be declared.  Such variables may be assigned pointers of </span><span class="style7">any</span><span class="style3"> other type:
  11661. </span><span class="style4">
  11662.     float  f = 100.;
  11663.     void  *v_ptr;
  11664.     v_ptr = &f;
  11665. </span></text>
  11666.     </content>
  11667.     <content>
  11668.         <layer>background</layer>
  11669.         <id>7</id>
  11670.         <text>65</text>
  11671.     </content>
  11672.     <content>
  11673.         <layer>background</layer>
  11674.         <id>29</id>
  11675.         <text>20338
  11676. </text>
  11677.     </content>
  11678.     <content>
  11679.         <layer>background</layer>
  11680.         <id>27</id>
  11681.         <text>Scope of variables</text>
  11682.     </content>
  11683.     <content>
  11684.         <layer>background</layer>
  11685.         <id>20</id>
  11686.         <text>Scope of variables - p84</text>
  11687.     </content>
  11688.     <name></name>
  11689.     <script></script>
  11690. </card>
  11691.  
  11692.  
  11693. card_75861.xml
  11694. <?xml version="1.0" encoding="utf-8" ?>
  11695. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11696. <card>
  11697.     <id>75861</id>
  11698.     <filler1>0</filler1>
  11699.     <cantDelete> <false /> </cantDelete>
  11700.     <showPict> <true /> </showPict>
  11701.     <dontSearch> <false /> </dontSearch>
  11702.     <owner>4755</owner>
  11703.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11704.     <content>
  11705.         <layer>background</layer>
  11706.         <id>4</id>
  11707.         <text><span class="style3">ONST POINTERS
  11708.  
  11709. The </span><span class="style4">const</span><span class="style3"> qualifer* may be applied to pointer variables in two ways.  The pointer itself may be declared constant, in which case it may not subsequently be set to point to a different location.  Alternately (or in addition), the pointer may be declared as pointing to an unchangeable value.  These are illustrated below:
  11710. </span><span class="style4">
  11711.     float         pi = 3.14159,
  11712.                   e = 2.71828;
  11713.     float *const  ptr1 = &pi;
  11714.     const float   *ptr2 = &pi;
  11715.  
  11716.     *ptr1 = 3.;   // ok, changes value of pi to 3.
  11717.     ptr1 = &e;    // disallowed since ptr1 is constant
  11718.     ptr2 = &e;    // ok, ptr2 now points to e
  11719.     *ptr2 = 3.;   // disallowed: can't change value through ptr2
  11720.  
  11721. </span><span class="style3">
  11722.  
  11723.  
  11724.  
  11725.  
  11726.  
  11727.  
  11728.  
  11729.  
  11730.  
  11731.  
  11732.  
  11733.  
  11734.  
  11735.  
  11736. </span></text>
  11737.     </content>
  11738.     <content>
  11739.         <layer>background</layer>
  11740.         <id>29</id>
  11741.         <text>70575</text>
  11742.     </content>
  11743.     <content>
  11744.         <layer>background</layer>
  11745.         <id>27</id>
  11746.         <text>const qualifier</text>
  11747.     </content>
  11748.     <content>
  11749.         <layer>background</layer>
  11750.         <id>20</id>
  11751.         <text>const qualifier - p62</text>
  11752.     </content>
  11753.     <content>
  11754.         <layer>background</layer>
  11755.         <id>7</id>
  11756.         <text>66</text>
  11757.     </content>
  11758.     <name></name>
  11759.     <script></script>
  11760. </card>
  11761.  
  11762.  
  11763. card_69591.xml
  11764. <?xml version="1.0" encoding="utf-8" ?>
  11765. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11766. <card>
  11767.     <id>69591</id>
  11768.     <filler1>0</filler1>
  11769.     <cantDelete> <false /> </cantDelete>
  11770.     <showPict> <true /> </showPict>
  11771.     <dontSearch> <false /> </dontSearch>
  11772.     <owner>4755</owner>
  11773.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11774.     <content>
  11775.         <layer>background</layer>
  11776.         <id>4</id>
  11777.         <text><span class="style3">ULL POINTER
  11778.  
  11779. The numerical address used to store a value is generally of little interest to the programmer.  However, a special pointer constant is used by many functions which deal with pointers: the </span><span class="style4">NULL</span><span class="style3"> pointer.  </span><span class="style4">NULL</span><span class="style3"> is a symbolic constant* declared in the system header file** </span><span class="style18">stddef.h</span><span class="style3"> (and often other headers as well).  It represents the zero address ‚Äî C guarantees that no data will validly have this address.  Therefore, </span><span class="style4">NULL</span><span class="style3"> is usually used to signify an abnormal event, or to initialize pointer variables to an "unused" state.  For example, 
  11780. </span><span class="style4">
  11781.     # include  <stddef.h>
  11782.         .
  11783.         .
  11784.  
  11785.     if (f_ptr != NULL)
  11786.         amplitude = *f_ptr;</span></text>
  11787.     </content>
  11788.     <content>
  11789.         <layer>background</layer>
  11790.         <id>29</id>
  11791.         <text>51878
  11792. 52189</text>
  11793.     </content>
  11794.     <content>
  11795.         <layer>background</layer>
  11796.         <id>27</id>
  11797.         <text>Macro substitution
  11798. File inclusion</text>
  11799.     </content>
  11800.     <content>
  11801.         <layer>background</layer>
  11802.         <id>20</id>
  11803.         <text>Macro substitution - p192</text>
  11804.     </content>
  11805.     <content>
  11806.         <layer>background</layer>
  11807.         <id>23</id>
  11808.         <text>File inclusion - p199</text>
  11809.     </content>
  11810.     <content>
  11811.         <layer>background</layer>
  11812.         <id>7</id>
  11813.         <text>67</text>
  11814.     </content>
  11815.     <name></name>
  11816.     <script></script>
  11817. </card>
  11818.  
  11819.  
  11820. card_22415.xml
  11821. <?xml version="1.0" encoding="utf-8" ?>
  11822. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11823. <card>
  11824.     <id>22415</id>
  11825.     <filler1>0</filler1>
  11826.     <cantDelete> <false /> </cantDelete>
  11827.     <showPict> <true /> </showPict>
  11828.     <dontSearch> <false /> </dontSearch>
  11829.     <owner>4755</owner>
  11830.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11831.     <content>
  11832.         <layer>background</layer>
  11833.         <id>7</id>
  11834.         <text>68</text>
  11835.     </content>
  11836.     <content>
  11837.         <layer>background</layer>
  11838.         <id>4</id>
  11839.         <text><span class="style3">n </span><span class="style7">array</span><span class="style3"> is a sequence of values of a given data type, arranged contiguously in memory.  Arrays are declared by following the identifier with an integer constant enclosed in [] brackets.  To declare an array of 10 floats requires:
  11840. </span><span class="style4">
  11841.     float    f_array[10];
  11842.  
  11843. </span><span class="style3">Individual </span><span class="style7">elements</span><span class="style3"> of an array are accessed using the index in brackets.  Indexing begins at 0, so in the above example, elements </span><span class="style4">f_array[0]</span><span class="style3"> through </span><span class="style4">f_array[9]</span><span class="style3"> are allocated appropriately, but </span><span class="style4">f_array[10]</span><span class="style3"> should not be accessed.
  11844. </span><span class="style4">
  11845.     f_array[5] = 100.;
  11846.  
  11847. </span><span class="style3">Multi-dimensional arrays are declared using the following syntax:
  11848. </span><span class="style4">
  11849.     float    f_array[10] [10];
  11850.  
  11851. </span><span class="style3">This declares a 10 by 10 array.  The indexing begins with 0 for both rows and columns.</span></text>
  11852.     </content>
  11853.     <content>
  11854.         <layer>background</layer>
  11855.         <id>6</id>
  11856.         <text>2.3  Arrays</text>
  11857.     </content>
  11858.     <name></name>
  11859.     <script></script>
  11860. </card>
  11861.  
  11862.  
  11863. card_24803.xml
  11864. <?xml version="1.0" encoding="utf-8" ?>
  11865. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11866. <card>
  11867.     <id>24803</id>
  11868.     <filler1>0</filler1>
  11869.     <cantDelete> <false /> </cantDelete>
  11870.     <showPict> <true /> </showPict>
  11871.     <dontSearch> <false /> </dontSearch>
  11872.     <owner>4755</owner>
  11873.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11874.     <content>
  11875.         <layer>background</layer>
  11876.         <id>4</id>
  11877.         <text><span class="style3">RRAYS & POINTERS
  11878.  
  11879. Like characters, pointers can be (carefully!) mixed with integer values in expressions.  A pointer represents a machine address, which is itself a (usually long) integer.  However, C simplifies pointer arithmetic by making use of the known size of the data type pointed to by the pointer.  Thus, if </span><span class="style4">f_ptr</span><span class="style3"> is declared as a pointer to a floating-point value on a machine where each float requires 4 machine addresses, then (</span><span class="style4">f_ptr + 1</span><span class="style3">) points 4 machine addresses beyond </span><span class="style4">f_ptr</span><span class="style3">.
  11880.  
  11881. Since arrays are stored contiguously, this means that if a pointer represents the address of an element of the array, then incrementing the pointer will cause it to point to the next element of the array, regardless of the type of the array.  The following assigns the value 100 to element 6 of the array:
  11882. </span><span class="style4">
  11883.     float    *f_ptr;
  11884.     float    f_array[10];
  11885.     f_ptr = &f_array[5];
  11886.     *(f_ptr+1) = 100.;</span></text>
  11887.     </content>
  11888.     <content>
  11889.         <layer>background</layer>
  11890.         <id>7</id>
  11891.         <text>69</text>
  11892.     </content>
  11893.     <name></name>
  11894.     <script></script>
  11895. </card>
  11896.  
  11897.  
  11898. card_25001.xml
  11899. <?xml version="1.0" encoding="utf-8" ?>
  11900. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11901. <card>
  11902.     <id>25001</id>
  11903.     <filler1>0</filler1>
  11904.     <cantDelete> <false /> </cantDelete>
  11905.     <showPict> <true /> </showPict>
  11906.     <dontSearch> <false /> </dontSearch>
  11907.     <owner>4755</owner>
  11908.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11909.     <content>
  11910.         <layer>background</layer>
  11911.         <id>4</id>
  11912.         <text><span class="style3">n fact, the identifier of the array is itself treated as a pointer to the zeroth element of the array (remember array indexing begins with 0).  The following are equivalent:
  11913. </span><span class="style4">
  11914.     f_array         and    &f_array[0]
  11915.     f_array+1       and    &f_array[1]
  11916.     *(f_array+1)    and    f_array[1]
  11917.  
  11918. </span><span class="style3">That is, the syntax:  </span><span class="style4">name[i]</span><span class="style3"> is treated the same as:  </span><span class="style4">*(name+i)</span><span class="style3"> in C.  If </span><span class="style4">f_ptr</span><span class="style3"> contains the address of </span><span class="style4">f_array[5]</span><span class="style3">, then the following are equivalent:
  11919. </span><span class="style4">
  11920.     f_ptr[1]    and    f_array[6] 
  11921.  
  11922. </span><span class="style3">However, an important distinction between an array identifier and a true pointer variable is that the former is a constant address, and cannot have a new value assigned to it:
  11923. </span><span class="style4">
  11924.     f_array = f_ptr;    //  disallowed, since f_array is a pointer constant,
  11925.                         //  not variable  
  11926.  
  11927. </span><span class="style3">
  11928. </span></text>
  11929.     </content>
  11930.     <content>
  11931.         <layer>background</layer>
  11932.         <id>7</id>
  11933.         <text>70</text>
  11934.     </content>
  11935.     <content>
  11936.         <layer>background</layer>
  11937.         <id>17</id>
  11938.         <text>p66</text>
  11939.     </content>
  11940.     <name></name>
  11941.     <script></script>
  11942. </card>
  11943.  
  11944.  
  11945. card_27221.xml
  11946. <?xml version="1.0" encoding="utf-8" ?>
  11947. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11948. <card>
  11949.     <id>27221</id>
  11950.     <filler1>0</filler1>
  11951.     <cantDelete> <false /> </cantDelete>
  11952.     <showPict> <true /> </showPict>
  11953.     <dontSearch> <false /> </dontSearch>
  11954.     <owner>4755</owner>
  11955.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11956.     <content>
  11957.         <layer>background</layer>
  11958.         <id>4</id>
  11959.         <text>Using pointers to traverse arrays often allows more efficient algorithms than can be obtained using ordinary array indexing.
  11960. </text>
  11961.     </content>
  11962.     <content>
  11963.         <layer>background</layer>
  11964.         <id>7</id>
  11965.         <text>71</text>
  11966.     </content>
  11967.     <content>
  11968.         <layer>background</layer>
  11969.         <id>17</id>
  11970.         <text>p66</text>
  11971.     </content>
  11972.     <name></name>
  11973.     <script></script>
  11974. </card>
  11975.  
  11976.  
  11977. card_25356.xml
  11978. <?xml version="1.0" encoding="utf-8" ?>
  11979. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  11980. <card>
  11981.     <id>25356</id>
  11982.     <filler1>0</filler1>
  11983.     <cantDelete> <false /> </cantDelete>
  11984.     <showPict> <true /> </showPict>
  11985.     <dontSearch> <false /> </dontSearch>
  11986.     <owner>4755</owner>
  11987.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  11988.     <content>
  11989.         <layer>background</layer>
  11990.         <id>4</id>
  11991.         <text><span class="style3">HARACTER STRINGS
  11992.  
  11993. A character string constant is a sequence of characters enclosed in double quotes, and represents an array of character values.  The last element of the array is the non-printable "null" character: '</span><span class="style4">\0</span><span class="style3">', supplied automatically in string constants.  A string constant is treated by C syntactically as the name of a character array, which itself is a pointer to the zeroth element of the array.  Thus the following assigns the address of the zeroth element of the string "Hello, world!" to </span><span class="style4">c_ptr</span><span class="style3">:
  11994. </span><span class="style4">
  11995.     char    *c_ptr;
  11996.     c_ptr = "Hello, world!";
  11997.  
  11998. </span><span class="style3">The elements of this string may be accessed using either array indexing:  </span><span class="style4">c_ptr[4]</span><span class="style3">, or pointer arithmetic:  </span><span class="style4">*(c_ptr+4)</span><span class="style3">.  It is important to note that the string defined above is a constant value and ANSI C disallows assignments which change it:
  11999. </span><span class="style4">
  12000.     c_ptr[4] = 'x';        //  disallowed in this case, since "Hello, world!"
  12001.                            //  is a constant  
  12002. </span></text>
  12003.     </content>
  12004.     <content>
  12005.         <layer>background</layer>
  12006.         <id>7</id>
  12007.         <text>72</text>
  12008.     </content>
  12009.     <content>
  12010.         <layer>background</layer>
  12011.         <id>17</id>
  12012.         <text>p66</text>
  12013.     </content>
  12014.     <name></name>
  12015.     <script></script>
  12016. </card>
  12017.  
  12018.  
  12019. card_25644.xml
  12020. <?xml version="1.0" encoding="utf-8" ?>
  12021. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12022. <card>
  12023.     <id>25644</id>
  12024.     <filler1>0</filler1>
  12025.     <cantDelete> <false /> </cantDelete>
  12026.     <showPict> <true /> </showPict>
  12027.     <dontSearch> <false /> </dontSearch>
  12028.     <owner>4755</owner>
  12029.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12030.     <content>
  12031.         <layer>background</layer>
  12032.         <id>4</id>
  12033.         <text><span class="style3">ecall that while the name of an array can be thought of as a pointer, it is also a constant and cannot have a new address assigned to it.  Therefore the following is also disallowed:
  12034. </span><span class="style4">
  12035.     char    c_array[14];
  12036.     c_array = "Hello, world!";  //  disallowed since c_array is a constant 
  12037.  
  12038. </span><span class="style3">C does not provide built-in operators for manipulating arrays.  Fortunately, functions to perform string manipulation are included in the standard C function libraries, which ‚Äî when linked together with the programmer's own code ‚Äî serve to extend the C language.  The </span><span class="style4">strcpy()</span><span class="style3"> function takes two character array name (i.e. character pointer) arguments and copies the elements of the second array to those of the first.  It does </span><span class="style7">not</span><span class="style3"> simply copy the second pointer to the first.  </span><span class="style4">strcpy()</span><span class="style3"> requires that the second array contain a terminating null character '</span><span class="style4">\0</span><span class="style3">'.  (Note that </span><span class="style4">c_array</span><span class="style3"> allocates 14 elements to accomodate the extra character.)
  12039. </span><span class="style4">
  12040.     char    c_array[14];
  12041.     strcpy(c_array,"Hello, world!");       // must  '#include <string.h>'
  12042. </span><span class="style3">
  12043. </span></text>
  12044.     </content>
  12045.     <content>
  12046.         <layer>background</layer>
  12047.         <id>7</id>
  12048.         <text>73</text>
  12049.     </content>
  12050.     <content>
  12051.         <layer>background</layer>
  12052.         <id>17</id>
  12053.         <text>p66</text>
  12054.     </content>
  12055.     <name></name>
  12056.     <script></script>
  12057. </card>
  12058.  
  12059.  
  12060. card_20884.xml
  12061. <?xml version="1.0" encoding="utf-8" ?>
  12062. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12063. <card>
  12064.     <id>20884</id>
  12065.     <filler1>0</filler1>
  12066.     <cantDelete> <false /> </cantDelete>
  12067.     <showPict> <true /> </showPict>
  12068.     <dontSearch> <false /> </dontSearch>
  12069.     <owner>4755</owner>
  12070.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12071.     <content>
  12072.         <layer>background</layer>
  12073.         <id>6</id>
  12074.         <text>2.4  User-Defined Types</text>
  12075.     </content>
  12076.     <content>
  12077.         <layer>background</layer>
  12078.         <id>4</id>
  12079.         <text><span class="style3"> provides the facility to create several kinds of custom data types.  Arrays of and pointers to custom data types are also permitted, using identical syntax to that for ordinary int, float, and char variables.  In effect, a consistent extension to the C language is thus defined.
  12080.  
  12081. Defining any of the custom types is usually done with the following syntax:
  12082. </span><span class="style4">
  12083.     <kind of custom type>  <name given to custom type>
  12084.     {
  12085.         <list of members of custom type>
  12086.                                   .
  12087.                                   .
  12088.     };
  12089.  
  12090. </span><span class="style3">(The trailing semicolon , or "null" statement, is required.  The syntax requires a statement to follow the closing bracket.  Occasionaly the programmer will place an identifier before the semicolon to declare a variable of the new type immediately.)
  12091. </span></text>
  12092.     </content>
  12093.     <content>
  12094.         <layer>background</layer>
  12095.         <id>7</id>
  12096.         <text>74</text>
  12097.     </content>
  12098.     <name></name>
  12099.     <script></script>
  12100. </card>
  12101.  
  12102.  
  12103. card_25150.xml
  12104. <?xml version="1.0" encoding="utf-8" ?>
  12105. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12106. <card>
  12107.     <id>25150</id>
  12108.     <filler1>0</filler1>
  12109.     <cantDelete> <false /> </cantDelete>
  12110.     <showPict> <true /> </showPict>
  12111.     <dontSearch> <false /> </dontSearch>
  12112.     <owner>4755</owner>
  12113.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12114.     <content>
  12115.         <layer>background</layer>
  12116.         <id>4</id>
  12117.         <text><span class="style3">TRUCTURES
  12118.  
  12119. The most useful kind of custom data type is the structure, or record.  The structure groups several different data types together so they may be manipulated using a single name.  A structure representing a personnel record may look like:
  12120. </span><span class="style4">
  12121.     struct       personnel_rec
  12122.     {
  12123.         char     name[80];
  12124.         int      id_number;
  12125.         float    salary;
  12126.     };
  12127.  
  12128. </span><span class="style3">The name, or </span><span class="style7">tag</span><span class="style3">, of this new data type follows identifier naming rules.*  (Some programmers capitalize the first or all letters of the tag.)  Although the foregoing defines the new data type, it does not yet allocate space for a variable having this type.  A new variable named </span><span class="style4">jack</span><span class="style3"> is declared using:
  12129. </span><span class="style4">
  12130.     struct personnel_rec  jack;
  12131. </span><span class="style3">
  12132. </span></text>
  12133.     </content>
  12134.     <content>
  12135.         <layer>background</layer>
  12136.         <id>7</id>
  12137.         <text>75</text>
  12138.     </content>
  12139.     <content>
  12140.         <layer>background</layer>
  12141.         <id>29</id>
  12142.         <text>22558</text>
  12143.     </content>
  12144.     <content>
  12145.         <layer>background</layer>
  12146.         <id>27</id>
  12147.         <text>Identifier naming conventions</text>
  12148.     </content>
  12149.     <content>
  12150.         <layer>background</layer>
  12151.         <id>20</id>
  12152.         <text>Identifier naming conventions - p56</text>
  12153.     </content>
  12154.     <name></name>
  12155.     <script></script>
  12156. </card>
  12157.  
  12158.  
  12159. card_26007.xml
  12160. <?xml version="1.0" encoding="utf-8" ?>
  12161. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12162. <card>
  12163.     <id>26007</id>
  12164.     <filler1>0</filler1>
  12165.     <cantDelete> <false /> </cantDelete>
  12166.     <showPict> <true /> </showPict>
  12167.     <dontSearch> <false /> </dontSearch>
  12168.     <owner>4755</owner>
  12169.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12170.     <content>
  12171.         <layer>background</layer>
  12172.         <id>4</id>
  12173.         <text><span class="style3">ndividual members of this structure variable are accessed using the </span><span class="style7">dot</span><span class="style3"> (</span><span class="style4">.</span><span class="style3">) operator:
  12174. </span><span class="style4">
  12175.     strcpy(jack.name,"Jack Nicklaus");
  12176.     jack.id_number = 12345;
  12177.     jack.salary = 1.4e6;
  12178.  
  12179. </span><span class="style3">Structure variables may be used in the same way as variables of the basic data types.  The programmer can declare an array of structure variables, assign a variable to another variable of the same type, pass a structure variable to an appropriately-defined function, etc.
  12180. </span><span class="style4">
  12181.     struct personnel_rec  person[10];
  12182.     strcpy(person[0].name,"John Doe");
  12183.     person[0].id_number = 999;
  12184.     person[0].salary = 30000.;
  12185.     person[1] = person[0];</span></text>
  12186.     </content>
  12187.     <content>
  12188.         <layer>background</layer>
  12189.         <id>7</id>
  12190.         <text>76</text>
  12191.     </content>
  12192.     <content>
  12193.         <layer>background</layer>
  12194.         <id>17</id>
  12195.         <text>p202</text>
  12196.     </content>
  12197.     <name></name>
  12198.     <script></script>
  12199. </card>
  12200.  
  12201.  
  12202. card_26199.xml
  12203. <?xml version="1.0" encoding="utf-8" ?>
  12204. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12205. <card>
  12206.     <id>26199</id>
  12207.     <filler1>0</filler1>
  12208.     <cantDelete> <false /> </cantDelete>
  12209.     <showPict> <true /> </showPict>
  12210.     <dontSearch> <false /> </dontSearch>
  12211.     <owner>4755</owner>
  12212.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12213.     <content>
  12214.         <layer>background</layer>
  12215.         <id>4</id>
  12216.         <text><span class="style3">requently pointers are used to structure variables.  A special operator </span><span class="style4">-></span><span class="style3"> is used in place of the dot operator to access members of a structure pointed to by a pointer variable, to avoid cumbersome syntax.  It is important to remember to define a non-pointer variable as well in order to allocate space for the structure itself:
  12217. </span><span class="style4">
  12218.     struct personnel_rec  *person_ptr,
  12219.                           jack;
  12220.     person_ptr = &jack;  //  if you forget this you may crash the program!  
  12221.     person_ptr->salary = 1.5e6; //  same as:  (*person_ptr).salary = 1.5e6  
  12222.  
  12223. </span><span class="style3">The same array-pointer relationship holds as that for the basic data types.
  12224. </span><span class="style4">
  12225.     struct personnel_rec  person[10];
  12226.     (person+1)->salary = 1.5e6;   //  ok since space is allocated above  
  12227.  
  12228. </span><span class="style3">It is illegal to declare a member of a struct to be a variable of the same user-defined type.  For example, a </span><span class="style4">personnel_rec</span><span class="style3"> variable may not be a member of the </span><span class="style4">personnel_rec</span><span class="style3"> type, for obvious reasons.  However, it is legal to declare a member to
  12229. </span></text>
  12230.     </content>
  12231.     <content>
  12232.         <layer>background</layer>
  12233.         <id>7</id>
  12234.         <text>77</text>
  12235.     </content>
  12236.     <content>
  12237.         <layer>background</layer>
  12238.         <id>17</id>
  12239.         <text>p202</text>
  12240.     </content>
  12241.     <name></name>
  12242.     <script></script>
  12243. </card>
  12244.  
  12245.  
  12246. card_33145.xml
  12247. <?xml version="1.0" encoding="utf-8" ?>
  12248. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12249. <card>
  12250.     <id>33145</id>
  12251.     <filler1>0</filler1>
  12252.     <cantDelete> <false /> </cantDelete>
  12253.     <showPict> <true /> </showPict>
  12254.     <dontSearch> <false /> </dontSearch>
  12255.     <owner>4755</owner>
  12256.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12257.     <content>
  12258.         <layer>background</layer>
  12259.         <id>4</id>
  12260.         <text><span class="style3">e a pointer to a variable of the same type.  For example, a variable of type "</span><span class="style4">struct personnel_rec*</span><span class="style3">" may be a member of the </span><span class="style4">personnel_rec</span><span class="style3"> type.  Moreover, member variables may be declared to be of another user-defined type, such as a union or enum type, as discussed in the following pages.
  12261.  
  12262. Think C and C++ extend C's struct declaration to support object-oriented programming techniques, as discussed in Chapter 4.</span></text>
  12263.     </content>
  12264.     <content>
  12265.         <layer>background</layer>
  12266.         <id>7</id>
  12267.         <text>78</text>
  12268.     </content>
  12269.     <content>
  12270.         <layer>background</layer>
  12271.         <id>18</id>
  12272.         <text>p207</text>
  12273.     </content>
  12274.     <name></name>
  12275.     <script></script>
  12276. </card>
  12277.  
  12278.  
  12279. card_26498.xml
  12280. <?xml version="1.0" encoding="utf-8" ?>
  12281. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12282. <card>
  12283.     <id>26498</id>
  12284.     <filler1>0</filler1>
  12285.     <cantDelete> <false /> </cantDelete>
  12286.     <showPict> <true /> </showPict>
  12287.     <dontSearch> <false /> </dontSearch>
  12288.     <owner>4755</owner>
  12289.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12290.     <content>
  12291.         <layer>background</layer>
  12292.         <id>4</id>
  12293.         <text><span class="style3">YPEDEF
  12294.  
  12295. Typedef declarations simply allow the programmer to define synonyms for commonly-used data types.  (Again, these synonyms must follow identifier naming rules.*  Some programmers capitalize the first or all letters in the synonym.)  For example, if the programmer wants to define variables which take on integer values but which are treated as boolean variables (only 0 or 1 allowed) in his/her own code, the following declaration may be used:
  12296. </span><span class="style4">
  12297.     typedef  int  boolean;      //  just do this once, at top of file 
  12298.     boolean  success;           //  success is actually an int variable 
  12299.  
  12300. </span><span class="style3">If pointers to </span><span class="style4">personnel_rec</span><span class="style3"> structures are used frequently, the following may be used:
  12301. </span><span class="style4">
  12302.     typedef struct personnel_rec*  pr_ptr;  // do this once, at top of file 
  12303.     pr_ptr  person;          //  same as:  struct personnel_rec *person </span></text>
  12304.     </content>
  12305.     <content>
  12306.         <layer>background</layer>
  12307.         <id>7</id>
  12308.         <text>79</text>
  12309.     </content>
  12310.     <content>
  12311.         <layer>background</layer>
  12312.         <id>29</id>
  12313.         <text>22558</text>
  12314.     </content>
  12315.     <content>
  12316.         <layer>background</layer>
  12317.         <id>27</id>
  12318.         <text>Identifier naming conventions</text>
  12319.     </content>
  12320.     <content>
  12321.         <layer>background</layer>
  12322.         <id>20</id>
  12323.         <text>Identifier naming conventions - p56</text>
  12324.     </content>
  12325.     <name></name>
  12326.     <script></script>
  12327. </card>
  12328.  
  12329.  
  12330. card_27786.xml
  12331. <?xml version="1.0" encoding="utf-8" ?>
  12332. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12333. <card>
  12334.     <id>27786</id>
  12335.     <filler1>0</filler1>
  12336.     <cantDelete> <false /> </cantDelete>
  12337.     <showPict> <true /> </showPict>
  12338.     <dontSearch> <false /> </dontSearch>
  12339.     <owner>4755</owner>
  12340.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12341.     <content>
  12342.         <layer>background</layer>
  12343.         <id>4</id>
  12344.         <text><span class="style3">NIONS
  12345.  
  12346. The syntax for defining and using unions is identical to that for structs.
  12347. </span><span class="style4">
  12348.     union    input_value
  12349.     {
  12350.         int      i;
  12351.         float    f;
  12352.     };
  12353.  
  12354. </span><span class="style3">Unlike a struct, however, declaring a variable of this type allocates space for only the </span><span class="style7">largest</span><span class="style3"> member in the union.  When a value is assigned to one of the members, any value formerly associated with another member is lost; that is, only one member contains a value at a time.  This property is useful when the programmer would like to define a variable which can take on values of different types at different points in  his/her program.</span></text>
  12355.     </content>
  12356.     <content>
  12357.         <layer>background</layer>
  12358.         <id>7</id>
  12359.         <text>80</text>
  12360.     </content>
  12361.     <content>
  12362.         <layer>background</layer>
  12363.         <id>17</id>
  12364.         <text>p202</text>
  12365.     </content>
  12366.     <name></name>
  12367.     <script></script>
  12368. </card>
  12369.  
  12370.  
  12371. card_27938.xml
  12372. <?xml version="1.0" encoding="utf-8" ?>
  12373. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12374. <card>
  12375.     <id>27938</id>
  12376.     <filler1>0</filler1>
  12377.     <cantDelete> <false /> </cantDelete>
  12378.     <showPict> <true /> </showPict>
  12379.     <dontSearch> <false /> </dontSearch>
  12380.     <owner>4755</owner>
  12381.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12382.     <content>
  12383.         <layer>background</layer>
  12384.         <id>4</id>
  12385.         <text><span class="style3">he following declares a variable of type "</span><span class="style4">union input_value</span><span class="style3">", and assigns values to it.
  12386. </span><span class="style4">
  12387.     union input_value  response;
  12388.     response.i = 7;
  12389.     response.f = 100.;     //  the value of response.i is now lost  
  12390.  
  12391. </span><span class="style3">Following the assignment to member </span><span class="style4">f</span><span class="style3">, the value assigned to member </span><span class="style4">i</span><span class="style3"> is no longer available, since the space allocated for it is shared by member </span><span class="style4">f</span><span class="style3">.
  12392.  
  12393.  
  12394. </span></text>
  12395.     </content>
  12396.     <content>
  12397.         <layer>background</layer>
  12398.         <id>7</id>
  12399.         <text>81</text>
  12400.     </content>
  12401.     <content>
  12402.         <layer>background</layer>
  12403.         <id>17</id>
  12404.         <text>p142</text>
  12405.     </content>
  12406.     <name></name>
  12407.     <script></script>
  12408. </card>
  12409.  
  12410.  
  12411. card_26884.xml
  12412. <?xml version="1.0" encoding="utf-8" ?>
  12413. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12414. <card>
  12415.     <id>26884</id>
  12416.     <filler1>0</filler1>
  12417.     <cantDelete> <false /> </cantDelete>
  12418.     <showPict> <true /> </showPict>
  12419.     <dontSearch> <false /> </dontSearch>
  12420.     <owner>4755</owner>
  12421.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12422.     <content>
  12423.         <layer>background</layer>
  12424.         <id>4</id>
  12425.         <text><span class="style3">NUMERATION TYPES
  12426.  
  12427. An enumeration type is used to define a variable which can take on only one of a set of values, to improve program clarity.  A comma-separated list of identifiers for these values is given.  These identifiers are internally treated as integer constants representing their position in the list, starting with 0.  The list is </span><span class="style7">not</span><span class="style3"> terminated with a semicolon.
  12428. </span><span class="style4">
  12429.     enum    day_of_week
  12430.     {
  12431.         Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday 
  12432.     };
  12433.  
  12434. </span><span class="style3">The syntax for declaring a variable of this type is similar to that for declaring a struct or union variable: 
  12435. </span><span class="style4">
  12436.     enum day_of_week  today;</span></text>
  12437.     </content>
  12438.     <content>
  12439.         <layer>background</layer>
  12440.         <id>7</id>
  12441.         <text>82</text>
  12442.     </content>
  12443.     <content>
  12444.         <layer>background</layer>
  12445.         <id>17</id>
  12446.         <text>p202</text>
  12447.     </content>
  12448.     <name></name>
  12449.     <script></script>
  12450. </card>
  12451.  
  12452.  
  12453. card_27616.xml
  12454. <?xml version="1.0" encoding="utf-8" ?>
  12455. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12456. <card>
  12457.     <id>27616</id>
  12458.     <filler1>0</filler1>
  12459.     <cantDelete> <false /> </cantDelete>
  12460.     <showPict> <true /> </showPict>
  12461.     <dontSearch> <false /> </dontSearch>
  12462.     <owner>4755</owner>
  12463.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12464.     <content>
  12465.         <layer>background</layer>
  12466.         <id>4</id>
  12467.         <text><span class="style3">ow the only values which should be assigned to this variable are the enumerated values:  </span><span class="style4">Monday</span><span class="style3">, </span><span class="style4">Tuesday</span><span class="style3">, etc.
  12468. </span><span class="style4">
  12469.     today = Tuesday;
  12470.     today = 1;         //  discouraged  
  12471.  
  12472. </span><span class="style3">Although the enumerated values are internally represented as integers, the second assignment above defeats the purpose of the enum type.  However, it is occasionally useful to mix enum variables and integers in expressions.</span></text>
  12473.     </content>
  12474.     <content>
  12475.         <layer>background</layer>
  12476.         <id>7</id>
  12477.         <text>83</text>
  12478.     </content>
  12479.     <content>
  12480.         <layer>background</layer>
  12481.         <id>17</id>
  12482.         <text>p142</text>
  12483.     </content>
  12484.     <name></name>
  12485.     <script></script>
  12486. </card>
  12487.  
  12488.  
  12489. card_20338.xml
  12490. <?xml version="1.0" encoding="utf-8" ?>
  12491. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12492. <card>
  12493.     <id>20338</id>
  12494.     <filler1>0</filler1>
  12495.     <cantDelete> <false /> </cantDelete>
  12496.     <showPict> <true /> </showPict>
  12497.     <dontSearch> <false /> </dontSearch>
  12498.     <owner>4755</owner>
  12499.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12500.     <content>
  12501.         <layer>background</layer>
  12502.         <id>4</id>
  12503.         <text><span class="style3"> programs consist of one or more </span><span class="style7">source files</span><span class="style3"> which contain the programmer's C source code.  These are linked together after compilation to produce the executable program.
  12504.  
  12505. The </span><span class="style7">scope</span><span class="style3"> of an identifier (user-defined type name, variable name, or function name) is the area of the source code from which the identifier can be accessed.  A variable's </span><span class="style7">storage class</span><span class="style3"> determines the allocation and deallocation of space for the variable.
  12506.  
  12507. There are 2 important scopes for identifiers in ANSI C.  An identifier with </span><span class="style7">block</span><span class="style3"> scope is "visible" only within the body of the function in which it is declared (a "local" identifier).  An identifier having </span><span class="style7">file</span><span class="style3"> scope must be declared outside of the body of any function in the source file, and can be accessed from any place in the file following where it is declared (a "global" identifier).
  12508.  
  12509. For example, the name (or "tag") for a user-defined data type may be defined at the beginning of a source file (file scope) so that it can be used to define variables of this 
  12510.  
  12511.  
  12512.  
  12513.  
  12514.  
  12515.  
  12516.  
  12517. </span></text>
  12518.     </content>
  12519.     <content>
  12520.         <layer>background</layer>
  12521.         <id>7</id>
  12522.         <text>84</text>
  12523.     </content>
  12524.     <content>
  12525.         <layer>background</layer>
  12526.         <id>6</id>
  12527.         <text>2.5  Scope & Storage Class</text>
  12528.     </content>
  12529.     <name></name>
  12530.     <script></script>
  12531. </card>
  12532.  
  12533.  
  12534. card_7805.xml
  12535. <?xml version="1.0" encoding="utf-8" ?>
  12536. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12537. <card>
  12538.     <id>7805</id>
  12539.     <filler1>0</filler1>
  12540.     <cantDelete> <false /> </cantDelete>
  12541.     <showPict> <true /> </showPict>
  12542.     <dontSearch> <false /> </dontSearch>
  12543.     <owner>4755</owner>
  12544.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12545.     <content>
  12546.         <layer>background</layer>
  12547.         <id>7</id>
  12548.         <text>85</text>
  12549.     </content>
  12550.     <content>
  12551.         <layer>background</layer>
  12552.         <id>4</id>
  12553.         <text><span class="style3">ype within any function later in the source file.
  12554.  
  12555. On the other hand, variables declared within a function body have block scope and do not conflict with variables having the same names but which are declared in other functions.  It is generally regarded as good practice to avoid declaring variables with file scope, to prevent confusion with like-named variables having block scope and to clarify the relationships among functions.  Rather, variables which are used by more than one function should be passed as function arguments wherever practical.
  12556.  
  12557. Unless declared </span><span class="style4">static</span><span class="style3"> (discussed later), an identifier with file scope is also available from within other source files, although it should be redeclared in each as discussed below.  Header files* are commonly used for the purpose of listing declarations of those identifiers which will be used in several source files.
  12558.  
  12559. Think C and C++ add a third scope ‚Äî </span><span class="style7">class</span><span class="style3"> ‚Äî applying to the instance variables of a user-defined class, as discussed in Chapter 4.
  12560. </span></text>
  12561.     </content>
  12562.     <content>
  12563.         <layer>background</layer>
  12564.         <id>29</id>
  12565.         <text>52189</text>
  12566.     </content>
  12567.     <content>
  12568.         <layer>background</layer>
  12569.         <id>27</id>
  12570.         <text>File inclusion</text>
  12571.     </content>
  12572.     <content>
  12573.         <layer>background</layer>
  12574.         <id>20</id>
  12575.         <text>File inclusion - p199</text>
  12576.     </content>
  12577.     <name></name>
  12578.     <script></script>
  12579. </card>
  12580.  
  12581.  
  12582. card_28174.xml
  12583. <?xml version="1.0" encoding="utf-8" ?>
  12584. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12585. <card>
  12586.     <id>28174</id>
  12587.     <filler1>0</filler1>
  12588.     <cantDelete> <false /> </cantDelete>
  12589.     <showPict> <true /> </showPict>
  12590.     <dontSearch> <false /> </dontSearch>
  12591.     <owner>4755</owner>
  12592.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12593.     <content>
  12594.         <layer>background</layer>
  12595.         <id>4</id>
  12596.         <text><span class="style3">efore discussing storage classes, we should distinguish between the terms </span><span class="style7">delcaration</span><span class="style3"> and </span><span class="style7">definition</span><span class="style3"> as used in this document.  A definition is something which describes the structure of or allocates space for something, whereas a declaration simply identifies the thing so the compiler is not confused.  The </span><span class="style4">personnel_rec</span><span class="style3"> struct expression discussed earlier* may be thought of as "declaring" the types of its members, since no space is yet allocated for these variables.  However, we say the struct expression "defines" the new </span><span class="style4">personnel_rec</span><span class="style3"> type by describing its structure.
  12597.  
  12598. When a variable is declared in the body of a function (block scope), it has the </span><span class="style7">automatic</span><span class="style3"> storage class by default.  Space for such a variable is automatically allocated upon declaration ‚Äî meaning that the declaration also serves as a definition ‚Äî and deallocated upon exit from this function.  If the function is called again at a later time, the value contained in this variable is generally </span><span class="style7">not</span><span class="style3"> the value remaining after the previous call.  (The declarations of some automatic variables may be preceded with the </span><span class="style4">register</span><span class="style3"> specifier.  This may speed access by using one of the machine's high-speed registers instead of standard memory.  The number of registers available</span></text>
  12599.     </content>
  12600.     <content>
  12601.         <layer>background</layer>
  12602.         <id>29</id>
  12603.         <text>25150</text>
  12604.     </content>
  12605.     <content>
  12606.         <layer>background</layer>
  12607.         <id>27</id>
  12608.         <text>personnel_rec structure</text>
  12609.     </content>
  12610.     <content>
  12611.         <layer>background</layer>
  12612.         <id>20</id>
  12613.         <text>personnel_rec structure - p75</text>
  12614.     </content>
  12615.     <content>
  12616.         <layer>background</layer>
  12617.         <id>7</id>
  12618.         <text>86</text>
  12619.     </content>
  12620.     <name></name>
  12621.     <script></script>
  12622. </card>
  12623.  
  12624.  
  12625. card_28465.xml
  12626. <?xml version="1.0" encoding="utf-8" ?>
  12627. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12628. <card>
  12629.     <id>28465</id>
  12630.     <filler1>0</filler1>
  12631.     <cantDelete> <false /> </cantDelete>
  12632.     <showPict> <true /> </showPict>
  12633.     <dontSearch> <false /> </dontSearch>
  12634.     <owner>4755</owner>
  12635.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12636.     <content>
  12637.         <layer>background</layer>
  12638.         <id>4</id>
  12639.         <text><span class="style3">nd the data types allowed are machine-dependent.  Standard memory will be used if no appropriate register is available.)
  12640.  
  12641. When a variable is declared outside the body of a function (file scope), it has the </span><span class="style7">static</span><span class="style3"> storage class by default.  Space for such a variable is allocated at the start of the program's execution, and is deallocated upon the program's termination.  As
  12642. mentioned earlier, this variable may be accessed from within other source files provided these source files redeclare the variable.  Since space for the variable must be allocated only once, the declaration in one and only one of the source files should also serve as a definition for the variable.  This is accomplished in one of two ways in ANSI C.  (1)  The (sole) definition is of the form "</span><span class="style4">int  id_number</span><span class="style3">" and the declarations in other files are of the form "</span><span class="style4">extern int  id_number</span><span class="style3">".  (2)  The (sole) definition involves an initialization as "</span><span class="style4">extern int  id_number = 0</span><span class="style3">" and the declarations in other files are of the form "</span><span class="style4">extern int  id_number</span><span class="style3">".
  12643.  
  12644. </span></text>
  12645.     </content>
  12646.     <content>
  12647.         <layer>background</layer>
  12648.         <id>7</id>
  12649.         <text>87</text>
  12650.     </content>
  12651.     <name></name>
  12652.     <script></script>
  12653. </card>
  12654.  
  12655.  
  12656. card_28872.xml
  12657. <?xml version="1.0" encoding="utf-8" ?>
  12658. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12659. <card>
  12660.     <id>28872</id>
  12661.     <filler1>0</filler1>
  12662.     <cantDelete> <false /> </cantDelete>
  12663.     <showPict> <true /> </showPict>
  12664.     <dontSearch> <false /> </dontSearch>
  12665.     <owner>4755</owner>
  12666.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12667.     <content>
  12668.         <layer>background</layer>
  12669.         <id>4</id>
  12670.         <text><span class="style3">lthough function definitions do not allocate space as variable definitions do, a distinction is still made between the function definition and a declaration of this entity.  Functions are defined in a single source file, and the function "prototype" is used to declare the function for access in other source files.*
  12671.  
  12672. Since the "definition" of a user-defined data type includes declarations needed by the compiler, it must be included in every source file using the data type.  As mentioned earlier, header files are usually used to avoid repetition.**
  12673.  
  12674. It is possible to override the default storage class for local variables (automatic) by using the </span><span class="style4">static</span><span class="style3"> storage class specifier:
  12675. </span><span class="style4">
  12676.     static int  cumulative_sum;
  12677.  
  12678. </span><span class="style3">Such a variable retains its previous value during subsequent function calls.  If an initialization is provided, it is assigned only the first time the function is called.
  12679.  
  12680. </span></text>
  12681.     </content>
  12682.     <content>
  12683.         <layer>background</layer>
  12684.         <id>7</id>
  12685.         <text>88</text>
  12686.     </content>
  12687.     <content>
  12688.         <layer>background</layer>
  12689.         <id>29</id>
  12690.         <text>31005
  12691. 52189</text>
  12692.     </content>
  12693.     <content>
  12694.         <layer>background</layer>
  12695.         <id>27</id>
  12696.         <text>Function scopes
  12697. File inclusion</text>
  12698.     </content>
  12699.     <content>
  12700.         <layer>background</layer>
  12701.         <id>20</id>
  12702.         <text>Function scopes - p103</text>
  12703.     </content>
  12704.     <content>
  12705.         <layer>background</layer>
  12706.         <id>23</id>
  12707.         <text>File inclusion - p199</text>
  12708.     </content>
  12709.     <name></name>
  12710.     <script></script>
  12711. </card>
  12712.  
  12713.  
  12714. card_29148.xml
  12715. <?xml version="1.0" encoding="utf-8" ?>
  12716. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12717. <card>
  12718.     <id>29148</id>
  12719.     <filler1>0</filler1>
  12720.     <cantDelete> <false /> </cantDelete>
  12721.     <showPict> <true /> </showPict>
  12722.     <dontSearch> <false /> </dontSearch>
  12723.     <owner>4755</owner>
  12724.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12725.     <content>
  12726.         <layer>background</layer>
  12727.         <id>4</id>
  12728.         <text><span class="style3">onfusingly, the </span><span class="style4">static</span><span class="style3"> specifier can also be applied to identifiers (variables, functions, type definitions) having file scope.  In this case, the storage class is not affected (since such variables are always static and functions and type definitions have no storage class) but it is no longer possible to access the identifier from other source files.  (In effect, the scope has been restricted to a single file only.)
  12729.  
  12730. This technique is often useful to organize a program into several source files, each of which has a restricted and well-defined interface with the other source files.  An alternative approach for obtaining such modularity is provided by the object-oriented features of TC and C++ discussed in Chapter 4.
  12731.  
  12732. TC/C++ adds a third storage class termed </span><span class="style7">free</span><span class="style3"> storage.  Allocation and deallocation of free-store variables occurs at points defined by the programmer, without regard for function boundaries.  This ability is also available to C programmers via the standard library functions malloc() and free(), but not as part of the language definition.
  12733.  
  12734.  
  12735. </span></text>
  12736.     </content>
  12737.     <content>
  12738.         <layer>background</layer>
  12739.         <id>7</id>
  12740.         <text>89</text>
  12741.     </content>
  12742.     <content>
  12743.         <layer>background</layer>
  12744.         <id>17</id>
  12745.         <text>p223</text>
  12746.     </content>
  12747.     <name></name>
  12748.     <script></script>
  12749. </card>
  12750.  
  12751.  
  12752. card_64457.xml
  12753. <?xml version="1.0" encoding="utf-8" ?>
  12754. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12755. <card>
  12756.     <id>64457</id>
  12757.     <filler1>0</filler1>
  12758.     <cantDelete> <false /> </cantDelete>
  12759.     <showPict> <true /> </showPict>
  12760.     <dontSearch> <false /> </dontSearch>
  12761.     <owner>4755</owner>
  12762.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12763.     <content>
  12764.         <layer>background</layer>
  12765.         <id>4</id>
  12766.         <text><span class="style3">he </span><span class="style4">new</span><span class="style3"> operator in TC/C++ returns a pointer to a block of memory large enough to accomodate the desired type, or the </span><span class="style4">NULL</span><span class="style3"> pointer if memory is unavailable.  The </span><span class="style4">delete</span><span class="style3"> operator deallocates the space pointed to by the pointer.
  12767. </span><span class="style4">
  12768.     struct personnel_rec  *jack;
  12769.     jack = new struct personnel_rec;   // allocate a personnel_rec
  12770.               .
  12771.               .
  12772.     delete jack;
  12773.  
  12774. </span><span class="style3">In Think C, these operators can only be applied to "class" types (Chapter 4).
  12775. </span></text>
  12776.     </content>
  12777.     <content>
  12778.         <layer>background</layer>
  12779.         <id>7</id>
  12780.         <text>90</text>
  12781.     </content>
  12782.     <content>
  12783.         <layer>background</layer>
  12784.         <id>17</id>
  12785.         <text>p215</text>
  12786.     </content>
  12787.     <name></name>
  12788.     <script></script>
  12789. </card>
  12790.  
  12791.  
  12792. card_22999.xml
  12793. <?xml version="1.0" encoding="utf-8" ?>
  12794. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12795. <card>
  12796.     <id>22999</id>
  12797.     <filler1>0</filler1>
  12798.     <cantDelete> <false /> </cantDelete>
  12799.     <showPict> <true /> </showPict>
  12800.     <dontSearch> <false /> </dontSearch>
  12801.     <owner>4755</owner>
  12802.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12803.     <content>
  12804.         <layer>background</layer>
  12805.         <id>6</id>
  12806.         <text>2.6  Example</text>
  12807.     </content>
  12808.     <content>
  12809.         <layer>background</layer>
  12810.         <id>4</id>
  12811.         <text><span class="style3">he following page contains a complete C program demonstrating the creation of enum and struct data types.  The code may be copied from the scrolling text field, pasted into a new source file </span><span class="style18">personnel.c</span><span class="style3">, and compiled. 
  12812. </span></text>
  12813.     </content>
  12814.     <content>
  12815.         <layer>background</layer>
  12816.         <id>7</id>
  12817.         <text>91</text>
  12818.     </content>
  12819.     <name></name>
  12820.     <script></script>
  12821. </card>
  12822.  
  12823.  
  12824. card_29601.xml
  12825. <?xml version="1.0" encoding="utf-8" ?>
  12826. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  12827. <card>
  12828.     <id>29601</id>
  12829.     <filler1>0</filler1>
  12830.     <cantDelete> <false /> </cantDelete>
  12831.     <showPict> <true /> </showPict>
  12832.     <dontSearch> <false /> </dontSearch>
  12833.     <owner>4755</owner>
  12834.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  12835.     <part>
  12836.         <id>1</id>
  12837.         <type>button</type>
  12838.         <visible> <true /> </visible>
  12839.         <reserved5> 0 </reserved5>
  12840.         <reserved4> 0 </reserved4>
  12841.         <reserved3> 0 </reserved3>
  12842.         <reserved2> 0 </reserved2>
  12843.         <reserved1> 0 </reserved1>
  12844.         <enabled> <true /> </enabled>
  12845.         <rect>
  12846.             <left>13</left>
  12847.             <top>29</top>
  12848.             <right>351</right>
  12849.             <bottom>57</bottom>
  12850.         </rect>
  12851.         <style>opaque</style>
  12852.         <showName> <false /> </showName>
  12853.         <highlight> <false /> </highlight>
  12854.         <autoHighlight> <false /> </autoHighlight>
  12855.         <sharedHighlight> <true /> </sharedHighlight>
  12856.         <family>0</family>
  12857.         <titleWidth>0</titleWidth>
  12858.         <icon>0</icon>
  12859.         <textAlign>center</textAlign>
  12860.         <font>Chicago</font>
  12861.         <textSize>12</textSize>
  12862.         <textStyle>plain</textStyle>
  12863.         <name>New Button</name>
  12864.         <script></script>
  12865.     </part>
  12866.     <part>
  12867.         <id>2</id>
  12868.         <type>field</type>
  12869.         <visible> <true /> </visible>
  12870.         <dontWrap> <false /> </dontWrap>
  12871.         <dontSearch> <false /> </dontSearch>
  12872.         <sharedText> <false /> </sharedText>
  12873.         <fixedLineHeight> <true /> </fixedLineHeight>
  12874.         <autoTab> <false /> </autoTab>
  12875.         <lockText> <false /> </lockText>
  12876.         <rect>
  12877.             <left>30</left>
  12878.             <top>76</top>
  12879.             <right>478</right>
  12880.             <bottom>296</bottom>
  12881.         </rect>
  12882.         <style>scrolling</style>
  12883.         <autoSelect> <false /> </autoSelect>
  12884.         <showLines> <false /> </showLines>
  12885.         <wideMargins> <false /> </wideMargins>
  12886.         <multipleLines> <false /> </multipleLines>
  12887.         <reservedFamily> 0 </reservedFamily>
  12888.         <titleWidth>0</titleWidth>
  12889.         <icon>0</icon>
  12890.         <textAlign>left</textAlign>
  12891.         <font>Monaco</font>
  12892.         <textSize>9</textSize>
  12893.         <textStyle>plain</textStyle>
  12894.         <textHeight>12</textHeight>
  12895.         <name>code</name>
  12896.         <script></script>
  12897.     </part>
  12898.     <part>
  12899.         <id>3</id>
  12900.         <type>button</type>
  12901.         <visible> <true /> </visible>
  12902.         <reserved5> 0 </reserved5>
  12903.         <reserved4> 0 </reserved4>
  12904.         <reserved3> 0 </reserved3>
  12905.         <reserved2> 0 </reserved2>
  12906.         <reserved1> 0 </reserved1>
  12907.         <enabled> <true /> </enabled>
  12908.         <rect>
  12909.             <left>169</left>
  12910.             <top>32</top>
  12911.             <right>305</right>
  12912.             <bottom>54</bottom>
  12913.         </rect>
  12914.         <style>roundrect</style>
  12915.         <showName> <true /> </showName>
  12916.         <highlight> <false /> </highlight>
  12917.         <autoHighlight> <true /> </autoHighlight>
  12918.         <sharedHighlight> <true /> </sharedHighlight>
  12919.         <family>0</family>
  12920.         <titleWidth>0</titleWidth>
  12921.         <icon>0</icon>
  12922.         <textAlign>center</textAlign>
  12923.         <font>Chicago</font>
  12924.         <textSize>12</textSize>
  12925.         <textStyle>plain</textStyle>
  12926.         <name>Copy to Clipboard</name>
  12927.         <script>on mouseUp
  12928. set lockscreen to true
  12929. select text of card field "code"
  12930. domenu "Copy Text"
  12931. select empty
  12932. set lockscreen to false
  12933. end mouseUp</script>
  12934.     </part>
  12935.     <content>
  12936.         <layer>background</layer>
  12937.         <id>6</id>
  12938.         <text>Example of user-defined data types</text>
  12939.     </content>
  12940.     <content>
  12941.         <layer>card</layer>
  12942.         <id>2</id>
  12943.         <text>/*
  12944. *   FILE:    personnel.c
  12945. *   AUTHOR:  R.G.
  12946. *   CREATED: June 20, 1990
  12947. *   
  12948. *   C program illustrating scope and use of user-defined data types.
  12949. *
  12950. *   PROJECT CONTENTS:
  12951. *   personnel.c, ANSI library
  12952. */
  12953.  
  12954. # include <stdio.h>   /* declares standard I/O functions */
  12955. # include <string.h>  /* declares string handling functions */
  12956.  
  12957. /******************************************************************
  12958. *   Definition of enum day_of_week type (file scope)
  12959. ******************************************************************/
  12960. enum    day_of_week
  12961. {
  12962.     Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday 
  12963. };
  12964.     /* synonym for 'enum day_of_week' is simply 'day_of_week': */
  12965. typedef enum day_of_week day_of_week;
  12966.  
  12967. /******************************************************************
  12968. *   Definition of struct personnel_rec type (file scope)
  12969. ******************************************************************/
  12970. struct    personnel_rec
  12971. {
  12972.     /* declare types of members, without allocating space yet: */
  12973.     char    name[80];     
  12974.     day_of_week    days_off[2];   /* member has enum type */
  12975.     /* legal circular reference using pointer: */
  12976.     struct personnel_rec  *boss; 
  12977. };
  12978. typedef struct personnel_rec personnel_rec;
  12979.  
  12980. /******************************************************************
  12981. *   main() function
  12982. ******************************************************************/
  12983. main()
  12984. {
  12985.     /* allocate two struct variables with block scope: */
  12986.     personnel_rec  employee[2];
  12987.     
  12988.     /* string copy function from standard libraries: */
  12989.     strcpy(employee[0].name,"Andrew Lipton");
  12990.     employee[0].days_off[0] = Saturday;
  12991.     employee[0].days_off[1] = Sunday;
  12992.     employee[0].boss = &employee[0];      /* Andy's his own boss! */
  12993.  
  12994.     strcpy(employee[1].name,"James Nutmeg");
  12995.     employee[1].days_off[0] = Sunday;
  12996.     employee[1].days_off[1] = Wednesday;
  12997.     employee[1].boss = &employee[0];
  12998.  
  12999.     /* use standard library function printf() for output: */
  13000.     printf("First employee: %s and his boss: %s\n",
  13001.            employee[0].name,(employee[0].boss)->name);
  13002.     printf("Second employee: %s and his boss: %s\n",
  13003.            employee[1].name,(employee[1].boss)->name);
  13004. }
  13005.  
  13006.  
  13007. </text>
  13008.     </content>
  13009.     <content>
  13010.         <layer>background</layer>
  13011.         <id>4</id>
  13012.         <text>This is a complete example demonstrating C data types:</text>
  13013.     </content>
  13014.     <content>
  13015.         <layer>background</layer>
  13016.         <id>7</id>
  13017.         <text>92</text>
  13018.     </content>
  13019.     <name></name>
  13020.     <script></script>
  13021. </card>
  13022.  
  13023.  
  13024. card_8539.xml
  13025. <?xml version="1.0" encoding="utf-8" ?>
  13026. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13027. <card>
  13028.     <id>8539</id>
  13029.     <filler1>0</filler1>
  13030.     <cantDelete> <false /> </cantDelete>
  13031.     <showPict> <true /> </showPict>
  13032.     <dontSearch> <false /> </dontSearch>
  13033.     <owner>4755</owner>
  13034.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13035.     <content>
  13036.         <layer>background</layer>
  13037.         <id>6</id>
  13038.         <text>3.  Functions  
  13039. </text>
  13040.     </content>
  13041.     <content>
  13042.         <layer>background</layer>
  13043.         <id>7</id>
  13044.         <text>93</text>
  13045.     </content>
  13046.     <content>
  13047.         <layer>background</layer>
  13048.         <id>4</id>
  13049.         <text>In C there is no syntactic distinction between procedures and functions.  A procedure is simply a function which does not return a useful value.  Traditionally C programs were constructed by decomposing the overall task into a hierarchy of functions and procedures.
  13050.  
  13051. As will be discussed in Chapter 4, Think C and C++ provide features which encourage the object-oriented programming approach, where the overall task is decomposed instead into a collection of interacting objects, each of which encapsulates data and the procedures ‚Äî or "member functions" ‚Äî which act upon this data.
  13052.  
  13053. An understanding of C functions is required before the programmer can construct objects, and traditional C functions also find uses in such programs.</text>
  13054.     </content>
  13055.     <content>
  13056.         <layer>background</layer>
  13057.         <id>17</id>
  13058.         <text>p215</text>
  13059.     </content>
  13060.     <name></name>
  13061.     <script></script>
  13062. </card>
  13063.  
  13064.  
  13065. card_12248.xml
  13066. <?xml version="1.0" encoding="utf-8" ?>
  13067. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13068. <card>
  13069.     <id>12248</id>
  13070.     <filler1>0</filler1>
  13071.     <cantDelete> <false /> </cantDelete>
  13072.     <showPict> <true /> </showPict>
  13073.     <dontSearch> <false /> </dontSearch>
  13074.     <owner>4755</owner>
  13075.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13076.     <content>
  13077.         <layer>background</layer>
  13078.         <id>6</id>
  13079.         <text>3.1  Prototypes</text>
  13080.     </content>
  13081.     <content>
  13082.         <layer>background</layer>
  13083.         <id>4</id>
  13084.         <text><span class="style3">he definition for an ANSI C function begins with a </span><span class="style7">function prototype</span><span class="style3">.  This heading gives the function name and declares the types of the </span><span class="style7">formal parameters</span><span class="style3"> and the type of the </span><span class="style7">return value</span><span class="style3"> of the function, if any.  The function syntax is:
  13085. </span><span class="style4">
  13086.     <type of return value>  <function name> (<parameter declarations>)
  13087.     {
  13088.         <function body>
  13089.                    .
  13090.                    .
  13091.     }
  13092.  
  13093. </span><span class="style3">Note there is no trailing semicolon following either the prototype or the function body.
  13094.  
  13095. Also note that pre-ANSI C functions list the parameters following the function name in the heading, but declare the types of these parameters in additional statements between the heading and the left bracket beginning the function body.
  13096. </span></text>
  13097.     </content>
  13098.     <content>
  13099.         <layer>background</layer>
  13100.         <id>7</id>
  13101.         <text>94</text>
  13102.     </content>
  13103.     <content>
  13104.         <layer>background</layer>
  13105.         <id>17</id>
  13106.         <text>p210</text>
  13107.     </content>
  13108.     <name></name>
  13109.     <script></script>
  13110. </card>
  13111.  
  13112.  
  13113. card_16372.xml
  13114. <?xml version="1.0" encoding="utf-8" ?>
  13115. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13116. <card>
  13117.     <id>16372</id>
  13118.     <filler1>0</filler1>
  13119.     <cantDelete> <false /> </cantDelete>
  13120.     <showPict> <true /> </showPict>
  13121.     <dontSearch> <false /> </dontSearch>
  13122.     <owner>4755</owner>
  13123.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13124.     <content>
  13125.         <layer>background</layer>
  13126.         <id>4</id>
  13127.         <text><span class="style3">or example, the following function returns the square of its argument.
  13128.  
  13129. ANSI C:
  13130. </span><span class="style4">
  13131.     float   square(float x)      //  function prototype  
  13132.     {
  13133.         return x*x;
  13134.     }
  13135.  
  13136.  
  13137. </span><span class="style3">Pre-ANSI C:
  13138. </span><span class="style4">
  13139.     float  square(x)             //  not an ANSI C prototype  
  13140.     float  x;
  13141.     {
  13142.         return x*x;
  13143.     }</span></text>
  13144.     </content>
  13145.     <content>
  13146.         <layer>background</layer>
  13147.         <id>7</id>
  13148.         <text>95</text>
  13149.     </content>
  13150.     <content>
  13151.         <layer>background</layer>
  13152.         <id>17</id>
  13153.         <text>p210</text>
  13154.     </content>
  13155.     <name></name>
  13156.     <script></script>
  13157. </card>
  13158.  
  13159.  
  13160. card_30689.xml
  13161. <?xml version="1.0" encoding="utf-8" ?>
  13162. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13163. <card>
  13164.     <id>30689</id>
  13165.     <filler1>0</filler1>
  13166.     <cantDelete> <false /> </cantDelete>
  13167.     <showPict> <true /> </showPict>
  13168.     <dontSearch> <false /> </dontSearch>
  13169.     <owner>4755</owner>
  13170.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13171.     <content>
  13172.         <layer>background</layer>
  13173.         <id>4</id>
  13174.         <text><span class="style3">he </span><span class="style4">return</span><span class="style3"> statement causes the function to terminate, and indicates the return value.
  13175.  
  13176. The parameters of the function (in this case the variable </span><span class="style4">x</span><span class="style3">) have the same scope and storage class as automatic variables:  they are only visible in the function body and they are allocated and deallocated upon entry to and exit from the function.
  13177.  
  13178. If the function does not require any formal parameters, the word </span><span class="style4">void</span><span class="style3"> should be used in place of its parameter list.  (In pre-ANSI C, the list is simply left empty.)  Likewise, if the function does not return a value its return type is declared as </span><span class="style4">void</span><span class="style3">.  For example:
  13179. </span><span class="style4">
  13180.     void  say_hello(void)
  13181.     {
  13182.         printf("Hello!\n");
  13183.         return;     // may be omitted in this case
  13184.     }
  13185. </span><span class="style3">
  13186. </span></text>
  13187.     </content>
  13188.     <content>
  13189.         <layer>background</layer>
  13190.         <id>7</id>
  13191.         <text>96</text>
  13192.     </content>
  13193.     <content>
  13194.         <layer>background</layer>
  13195.         <id>17</id>
  13196.         <text>p215</text>
  13197.     </content>
  13198.     <name></name>
  13199.     <script></script>
  13200. </card>
  13201.  
  13202.  
  13203. card_26691.xml
  13204. <?xml version="1.0" encoding="utf-8" ?>
  13205. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13206. <card>
  13207.     <id>26691</id>
  13208.     <filler1>0</filler1>
  13209.     <cantDelete> <false /> </cantDelete>
  13210.     <showPict> <true /> </showPict>
  13211.     <dontSearch> <false /> </dontSearch>
  13212.     <owner>4755</owner>
  13213.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13214.     <content>
  13215.         <layer>background</layer>
  13216.         <id>4</id>
  13217.         <text><span class="style3">n either ANSI C or pre-ANSI C, the </span><span class="style4">square()</span><span class="style3"> function is </span><span class="style7">called</span><span class="style3"> (evaluated) from another function by providing an </span><span class="style7">argument</span><span class="style3"> in parentheses:
  13218. </span><span class="style4">
  13219.     new_value = square(old_value);
  13220.  
  13221. </span><span class="style3">C functions are </span><span class="style7">call by value</span><span class="style3">, meaning the value passed to the function as its argument is assigned to the corresponding formal parameter when the function is called.  Any changes to the value of this formal parameter do </span><span class="style7">not</span><span class="style3"> affect the value of the argument used for the function call.  In the above example, if the </span><span class="style4">square()</span><span class="style3"> function had assigned a new value to its parameter </span><span class="style4">x</span><span class="style3">, the value of the variable </span><span class="style4">old_value</span><span class="style3"> in the calling function would remain unchanged.
  13222.  
  13223. C function calls are expressions, whose value is the value specified in the function's return statement, if any.  The above example assigns the value of the function call expression to the variable </span><span class="style4">new_value</span><span class="style3">; however, the function call could as well appear anywhere a C expression is allowed.  For example:
  13224. </span><span class="style4">
  13225.     new_value = square(square(old_value)/2.);
  13226. </span></text>
  13227.     </content>
  13228.     <content>
  13229.         <layer>background</layer>
  13230.         <id>6</id>
  13231.         <text>3.2  Function Calls</text>
  13232.     </content>
  13233.     <content>
  13234.         <layer>background</layer>
  13235.         <id>7</id>
  13236.         <text>97</text>
  13237.     </content>
  13238.     <content>
  13239.         <layer>background</layer>
  13240.         <id>17</id>
  13241.         <text>p142</text>
  13242.     </content>
  13243.     <name></name>
  13244.     <script></script>
  13245. </card>
  13246.  
  13247.  
  13248. card_30821.xml
  13249. <?xml version="1.0" encoding="utf-8" ?>
  13250. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13251. <card>
  13252.     <id>30821</id>
  13253.     <filler1>0</filler1>
  13254.     <cantDelete> <false /> </cantDelete>
  13255.     <showPict> <true /> </showPict>
  13256.     <dontSearch> <false /> </dontSearch>
  13257.     <owner>4755</owner>
  13258.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13259.     <content>
  13260.         <layer>background</layer>
  13261.         <id>4</id>
  13262.         <text><span class="style3">ften a function will return a value but the calling function will choose to ignore this value.  For example the standard library function </span><span class="style4">printf()</span><span class="style3"> prints its argument and returns the number of characters printed:
  13263. </span><span class="style4">
  13264.     printf("Hello\n");          //  return value ignored  
  13265.  
  13266. </span><span class="style3">If a function returns a void value, the above syntax should always be used, since void values cannot be used in other expressions.</span></text>
  13267.     </content>
  13268.     <content>
  13269.         <layer>background</layer>
  13270.         <id>7</id>
  13271.         <text>98</text>
  13272.     </content>
  13273.     <content>
  13274.         <layer>background</layer>
  13275.         <id>17</id>
  13276.         <text>p223</text>
  13277.     </content>
  13278.     <name></name>
  13279.     <script></script>
  13280. </card>
  13281.  
  13282.  
  13283. card_31791.xml
  13284. <?xml version="1.0" encoding="utf-8" ?>
  13285. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13286. <card>
  13287.     <id>31791</id>
  13288.     <filler1>0</filler1>
  13289.     <cantDelete> <false /> </cantDelete>
  13290.     <showPict> <true /> </showPict>
  13291.     <dontSearch> <false /> </dontSearch>
  13292.     <owner>4755</owner>
  13293.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13294.     <content>
  13295.         <layer>background</layer>
  13296.         <id>4</id>
  13297.         <text><span class="style3">OINTER ARGUMENTS
  13298.  
  13299. Since a function cannot alter the value of a variable which is passed as an argument, it may appear that the only way for a function to communicate with its calling function is via the return value.  Another way of establishing communication between functions is through global variables (variables with file scope).  However, the use of global variables can cause code to be difficult to debug and maintain.
  13300.  
  13301. A technique commonly used in C programs is to declare a formal parameter of the function to be a pointer variable.*  The calling program passes the address of a variable (using the </span><span class="style4">&</span><span class="style3"> operator) as an argument to the function.  The called function may assign a new value to the variable "pointed to" by its pointer parameter, thus altering the value of a variable in the calling function.
  13302.  
  13303. In effect, the block scope of the calling function's variable is subverted by making the variable accessible from within another function's body.  However, this is considered less problematic than the use of global variables since the scope boundaries remain </span></text>
  13304.     </content>
  13305.     <content>
  13306.         <layer>background</layer>
  13307.         <id>7</id>
  13308.         <text>99</text>
  13309.     </content>
  13310.     <content>
  13311.         <layer>background</layer>
  13312.         <id>29</id>
  13313.         <text>20555</text>
  13314.     </content>
  13315.     <content>
  13316.         <layer>background</layer>
  13317.         <id>27</id>
  13318.         <text>Pointer variables</text>
  13319.     </content>
  13320.     <content>
  13321.         <layer>background</layer>
  13322.         <id>20</id>
  13323.         <text>Pointer variables - p64</text>
  13324.     </content>
  13325.     <name></name>
  13326.     <script></script>
  13327. </card>
  13328.  
  13329.  
  13330. card_32462.xml
  13331. <?xml version="1.0" encoding="utf-8" ?>
  13332. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13333. <card>
  13334.     <id>32462</id>
  13335.     <filler1>0</filler1>
  13336.     <cantDelete> <false /> </cantDelete>
  13337.     <showPict> <true /> </showPict>
  13338.     <dontSearch> <false /> </dontSearch>
  13339.     <owner>4755</owner>
  13340.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13341.     <content>
  13342.         <layer>background</layer>
  13343.         <id>4</id>
  13344.         <text><span class="style3">ell-defined.
  13345.  
  13346. For example, consider the alternate </span><span class="style4">square()</span><span class="style3"> function, with no return value:
  13347. </span><span class="style4">
  13348.     void  square(float *f_ptr)
  13349.     {
  13350.         *f_ptr = (*f_ptr) * (*f_ptr);
  13351.     }
  13352.  
  13353. </span><span class="style3">This function may be called from another function as:
  13354. </span><span class="style4">
  13355.     square(&the_value);
  13356.  
  13357. </span><span class="style3">The value contained in the variable </span><span class="style4">the_value</span><span class="style3"> is thus squared.
  13358.  
  13359. This technique is also used when passing an array to a function, since the array name is treated as a pointer to the zeroth element of the array.  To pass this pointer as an argument, the array identifier is given without brackets.  An example is the following function which squares each element of an array containing 3 elements.</span></text>
  13360.     </content>
  13361.     <content>
  13362.         <layer>background</layer>
  13363.         <id>7</id>
  13364.         <text>100</text>
  13365.     </content>
  13366.     <content>
  13367.         <layer>background</layer>
  13368.         <id>17</id>
  13369.         <text>p142</text>
  13370.     </content>
  13371.     <name></name>
  13372.     <script></script>
  13373. </card>
  13374.  
  13375.  
  13376. card_32640.xml
  13377. <?xml version="1.0" encoding="utf-8" ?>
  13378. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13379. <card>
  13380.     <id>32640</id>
  13381.     <filler1>0</filler1>
  13382.     <cantDelete> <false /> </cantDelete>
  13383.     <showPict> <true /> </showPict>
  13384.     <dontSearch> <false /> </dontSearch>
  13385.     <owner>4755</owner>
  13386.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13387.     <content>
  13388.         <layer>background</layer>
  13389.         <id>4</id>
  13390.         <text><span class="style4">   void  square_array(float  *f_array) 
  13391.     {
  13392.         *f_array = (*f_array) * (*f_array);
  13393.         *(f_array+1) = (*(f_array+1)) * (*(f_array+1));
  13394.         *(f_array+2) = (*(f_array+2)) * (*(f_array+2));
  13395.     }
  13396.  
  13397. </span><span class="style3">An equivalent definition which is more appropriate in this case takes advantage of the use of array indexing in place of pointer arithmetic:
  13398. </span><span class="style4">
  13399.     void  square_array(float  f_array[])
  13400.     {
  13401.         f_array[0] = f_array[0] * f_array[0];
  13402.         f_array[1] = f_array[1] * f_array[1];
  13403.         f_array[2] = f_array[2] * f_array[2];
  13404.     }</span></text>
  13405.     </content>
  13406.     <content>
  13407.         <layer>background</layer>
  13408.         <id>7</id>
  13409.         <text>101</text>
  13410.     </content>
  13411.     <content>
  13412.         <layer>background</layer>
  13413.         <id>17</id>
  13414.         <text>p142</text>
  13415.     </content>
  13416.     <name></name>
  13417.     <script></script>
  13418. </card>
  13419.  
  13420.  
  13421. card_32967.xml
  13422. <?xml version="1.0" encoding="utf-8" ?>
  13423. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13424. <card>
  13425.     <id>32967</id>
  13426.     <filler1>0</filler1>
  13427.     <cantDelete> <false /> </cantDelete>
  13428.     <showPict> <true /> </showPict>
  13429.     <dontSearch> <false /> </dontSearch>
  13430.     <owner>4755</owner>
  13431.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13432.     <content>
  13433.         <layer>background</layer>
  13434.         <id>4</id>
  13435.         <text><span class="style3">he declaration "</span><span class="style4">float  f_array[]</span><span class="style3">" in the second version is a synonym for declaring </span><span class="style4">f_array</span><span class="style3"> to be a float pointer.  The number of elements in the array is inconsequential since </span><span class="style4">f_array</span><span class="style3"> is treated as a pointer.  The choice of notation is usually made based on how the pointer is to be used in the function.
  13436.  
  13437. The calling function may pass the array name to the new </span><span class="style4">square()</span><span class="style3"> function as follows:
  13438. </span><span class="style4">
  13439.     float   array_of_floats[3];      // declare array of 3 floats 
  13440.     array_of_floats[0] = 19.;
  13441.     array_of_floats[1] = 92.;
  13442.     array_of_floats[2] = 33.;
  13443.     square_array(array_of_floats);
  13444.  
  13445. </span><span class="style3">In addition to allowing the called function to affect the values of variables in the calling function, pointers are frequently used as function arguments to avoid the inefficiency of passing large user-defined structure variables to the function.  Rather, a pointer to the structure is passed.</span></text>
  13446.     </content>
  13447.     <content>
  13448.         <layer>background</layer>
  13449.         <id>7</id>
  13450.         <text>102</text>
  13451.     </content>
  13452.     <content>
  13453.         <layer>background</layer>
  13454.         <id>17</id>
  13455.         <text>p142</text>
  13456.     </content>
  13457.     <name></name>
  13458.     <script></script>
  13459. </card>
  13460.  
  13461.  
  13462. card_31005.xml
  13463. <?xml version="1.0" encoding="utf-8" ?>
  13464. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13465. <card>
  13466.     <id>31005</id>
  13467.     <filler1>0</filler1>
  13468.     <cantDelete> <false /> </cantDelete>
  13469.     <showPict> <true /> </showPict>
  13470.     <dontSearch> <false /> </dontSearch>
  13471.     <owner>4755</owner>
  13472.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13473.     <content>
  13474.         <layer>background</layer>
  13475.         <id>4</id>
  13476.         <text><span class="style3"> programs are usually divided into several source files, to improve modularity and to speed program development.  (Only the altered functions need to be recompiled.)
  13477.  
  13478. By default function identifiers have </span><span class="style7">file scope</span><span class="style3">, so the function can be accessed from any point following its declaration in a source file, and from any other source files which provide a suitable declaration.*
  13479.  
  13480. Recall that a function </span><span class="style7">definition</span><span class="style3"> describes the structure of the function whereas a </span><span class="style7">declaration</span><span class="style3"> simply informs the compiler of the types of the function's return value and arguments.  A complete function definition involves both the function prototype (the header) and the function body.  A function definition also serves as a function declaration.  Therefore if the called function's definition precedes the calling function in the source file, then no further declaration is needed.
  13481.  
  13482. If, however, a function is called before it is defined in the source file, or if the function is called from a function in another source file, then a declaration must be given.  A function is declared simply by giving the prototype followed by a </span></text>
  13483.     </content>
  13484.     <content>
  13485.         <layer>background</layer>
  13486.         <id>6</id>
  13487.         <text>3.3  Scope</text>
  13488.     </content>
  13489.     <content>
  13490.         <layer>background</layer>
  13491.         <id>7</id>
  13492.         <text>103</text>
  13493.     </content>
  13494.     <content>
  13495.         <layer>background</layer>
  13496.         <id>29</id>
  13497.         <text>20338</text>
  13498.     </content>
  13499.     <content>
  13500.         <layer>background</layer>
  13501.         <id>27</id>
  13502.         <text>ANSI C scopes</text>
  13503.     </content>
  13504.     <content>
  13505.         <layer>background</layer>
  13506.         <id>20</id>
  13507.         <text>ANSI C scopes - p84</text>
  13508.     </content>
  13509.     <name></name>
  13510.     <script></script>
  13511. </card>
  13512.  
  13513.  
  13514. card_31508.xml
  13515. <?xml version="1.0" encoding="utf-8" ?>
  13516. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13517. <card>
  13518.     <id>31508</id>
  13519.     <filler1>0</filler1>
  13520.     <cantDelete> <false /> </cantDelete>
  13521.     <showPict> <true /> </showPict>
  13522.     <dontSearch> <false /> </dontSearch>
  13523.     <owner>4755</owner>
  13524.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13525.     <content>
  13526.         <layer>background</layer>
  13527.         <id>4</id>
  13528.         <text><span class="style3">emicolon.  It is not necessary to list the names of the formal parameters; only their types.  For example:
  13529. </span><span class="style4">
  13530.    float   square(float);
  13531.  
  13532. </span><span class="style3">It is common practice to place lists of function prototype declarations in header files.*
  13533.  
  13534. Note that pre-ANSI C code does not use complete function prototype declarations.  Rather, a function is declared by stating the type of its return value and following the function identifier with empty parentheses to distinguish it as a function rather than a variable:
  13535. </span><span class="style4">
  13536.     float  square();
  13537.  
  13538. </span><span class="style3">The default return type for functions is </span><span class="style4">int</span><span class="style3">, and many pre-ANSI programs took advantage of this by not declaring those functions which returned ints at all.
  13539.  
  13540. </span></text>
  13541.     </content>
  13542.     <content>
  13543.         <layer>background</layer>
  13544.         <id>7</id>
  13545.         <text>104</text>
  13546.     </content>
  13547.     <content>
  13548.         <layer>background</layer>
  13549.         <id>29</id>
  13550.         <text>52189</text>
  13551.     </content>
  13552.     <content>
  13553.         <layer>background</layer>
  13554.         <id>27</id>
  13555.         <text>File inclusion</text>
  13556.     </content>
  13557.     <content>
  13558.         <layer>background</layer>
  13559.         <id>20</id>
  13560.         <text>File inclusion - p199</text>
  13561.     </content>
  13562.     <name></name>
  13563.     <script></script>
  13564. </card>
  13565.  
  13566.  
  13567. card_32050.xml
  13568. <?xml version="1.0" encoding="utf-8" ?>
  13569. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13570. <card>
  13571.     <id>32050</id>
  13572.     <filler1>0</filler1>
  13573.     <cantDelete> <false /> </cantDelete>
  13574.     <showPict> <true /> </showPict>
  13575.     <dontSearch> <false /> </dontSearch>
  13576.     <owner>4755</owner>
  13577.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13578.     <content>
  13579.         <layer>background</layer>
  13580.         <id>4</id>
  13581.         <text><span class="style3">hile some ANSI C compilers permit these short cuts, it is considered good practice to provide full prototype declarations for all functions.  In addition to aiding program maintenance, this allows the compiler to enforce type checking of the arguments, reducing type-conversion bugs.
  13582.  
  13583. The default file scope for function identifiers can be restricted with the </span><span class="style4">static</span><span class="style3"> specifier*, which disallows access from source files other from the one in which the function is defined.
  13584.  
  13585. Functions cannot have block scope, but TC and C++ functions can have class scope (Chapter 4).  This limits the function's scope to that of the body of data with which it is associated, which itself may be block scope, and to the bodies of other functions of the same class.
  13586.  
  13587.  
  13588.  
  13589.  
  13590.  
  13591. </span></text>
  13592.     </content>
  13593.     <content>
  13594.         <layer>background</layer>
  13595.         <id>7</id>
  13596.         <text>105</text>
  13597.     </content>
  13598.     <content>
  13599.         <layer>background</layer>
  13600.         <id>29</id>
  13601.         <text>28872</text>
  13602.     </content>
  13603.     <content>
  13604.         <layer>background</layer>
  13605.         <id>27</id>
  13606.         <text>Scope restriction with 'static'</text>
  13607.     </content>
  13608.     <content>
  13609.         <layer>background</layer>
  13610.         <id>20</id>
  13611.         <text>Scope restriction with 'static' - p88</text>
  13612.     </content>
  13613.     <content>
  13614.         <layer>background</layer>
  13615.         <id>17</id>
  13616.         <text>p210</text>
  13617.     </content>
  13618.     <name></name>
  13619.     <script></script>
  13620. </card>
  13621.  
  13622.  
  13623. card_9318.xml
  13624. <?xml version="1.0" encoding="utf-8" ?>
  13625. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13626. <card>
  13627.     <id>9318</id>
  13628.     <filler1>0</filler1>
  13629.     <cantDelete> <false /> </cantDelete>
  13630.     <showPict> <true /> </showPict>
  13631.     <dontSearch> <false /> </dontSearch>
  13632.     <owner>4755</owner>
  13633.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13634.     <content>
  13635.         <layer>background</layer>
  13636.         <id>4</id>
  13637.         <text><span class="style3">ll C programs begin execution with the function entitled </span><span class="style4">main</span><span class="style3">, and end execution when this function terminates.  The arguments and return value of this function are assigned and evaluated in an operating system-dependent manner.
  13638.  
  13639. Unix systems allow command-line arguments to be provided when a program is executed.  These arguments are usually assigned to </span><span class="style4">argv</span><span class="style3"> and </span><span class="style4">argc</span><span class="style3"> parameters which the </span><span class="style4">main()</span><span class="style3"> function may optionally access.
  13640.  
  13641. If the </span><span class="style4">main()</span><span class="style3"> function provides a </span><span class="style4">return</span><span class="style3"> statement, the value returned may be evaluated by the operating system to provide feedback to the user.
  13642.  
  13643. Think C for the Macintosh provides the </span><span class="style4">ccommand()</span><span class="style3"> function to simulate the use of command-line arguments.  Generally, the </span><span class="style4">main()</span><span class="style3"> function in Macintosh programs uses neither arguments nor a return value.
  13644. </span></text>
  13645.     </content>
  13646.     <content>
  13647.         <layer>background</layer>
  13648.         <id>7</id>
  13649.         <text>106</text>
  13650.     </content>
  13651.     <content>
  13652.         <layer>background</layer>
  13653.         <id>6</id>
  13654.         <text>3.4  The main() Function</text>
  13655.     </content>
  13656.     <content>
  13657.         <layer>background</layer>
  13658.         <id>18</id>
  13659.         <text>p251</text>
  13660.     </content>
  13661.     <name></name>
  13662.     <script></script>
  13663. </card>
  13664.  
  13665.  
  13666. card_33872.xml
  13667. <?xml version="1.0" encoding="utf-8" ?>
  13668. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13669. <card>
  13670.     <id>33872</id>
  13671.     <filler1>0</filler1>
  13672.     <cantDelete> <false /> </cantDelete>
  13673.     <showPict> <true /> </showPict>
  13674.     <dontSearch> <false /> </dontSearch>
  13675.     <owner>4755</owner>
  13676.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13677.     <content>
  13678.         <layer>background</layer>
  13679.         <id>4</id>
  13680.         <text><span class="style3"> functions may call themselves in a </span><span class="style7">recursive</span><span class="style3"> fashion.  For example, a function to raise a floating-point number to an integral power may be written:
  13681. </span><span class="style4">
  13682.     float  expon(float  x, int y)
  13683.     {
  13684.         if (y>0)
  13685.             return x * expon(x,y-1);
  13686.         else
  13687.             return 1.;
  13688.     }
  13689.  
  13690. </span><span class="style3">The scope of the formal parameters (and local variables, if any) of a function is the body of the function, and separate values for these variables are maintained for each invocation of the function.  Thus there is no conflict when passing the value "</span><span class="style4">y-1</span><span class="style3">" as an argument to the </span><span class="style4">expon()</span><span class="style3"> function, even though the identifier </span><span class="style4">y</span><span class="style3"> is itself used as a parameter of the called function.</span></text>
  13691.     </content>
  13692.     <content>
  13693.         <layer>background</layer>
  13694.         <id>7</id>
  13695.         <text>107</text>
  13696.     </content>
  13697.     <content>
  13698.         <layer>background</layer>
  13699.         <id>6</id>
  13700.         <text>3.5  Recursion</text>
  13701.     </content>
  13702.     <name></name>
  13703.     <script></script>
  13704. </card>
  13705.  
  13706.  
  13707. card_34369.xml
  13708. <?xml version="1.0" encoding="utf-8" ?>
  13709. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13710. <card>
  13711.     <id>34369</id>
  13712.     <filler1>0</filler1>
  13713.     <cantDelete> <false /> </cantDelete>
  13714.     <showPict> <true /> </showPict>
  13715.     <dontSearch> <false /> </dontSearch>
  13716.     <owner>4755</owner>
  13717.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13718.     <content>
  13719.         <layer>background</layer>
  13720.         <id>4</id>
  13721.         <text><span class="style3">n addition to containing the address of a variable, pointers may contain the address of a function.  This is a rather confusing notion; nonetheless function pointers find uses in certain applications.
  13722.  
  13723. Function pointers are declared in a manner similar to a function prototype declaration.  For example, a pointer to a function which returns a float and accepts one float and one int argument would be declared as follows:
  13724. </span><span class="style4">
  13725.     float  (*func_ptr)(float,int);  
  13726.  
  13727. </span><span class="style3">(In pre-ANSI C, the types of the arguments would be omitted from this declaration.)  The parentheses surrounding "</span><span class="style4">*func_ptr</span><span class="style3">" are required; otherwise this becomes a function prototype for a function returning a float pointer.
  13728.  
  13729. Since function identifiers may not themselves be passed as arguments to other functions, function pointers are often used for this purpose.  The called function declares one of its formal parameters to be a function pointer.  A function pointed to </span></text>
  13730.     </content>
  13731.     <content>
  13732.         <layer>background</layer>
  13733.         <id>7</id>
  13734.         <text>108</text>
  13735.     </content>
  13736.     <content>
  13737.         <layer>background</layer>
  13738.         <id>6</id>
  13739.         <text>3.6  Function Pointers</text>
  13740.     </content>
  13741.     <name></name>
  13742.     <script></script>
  13743. </card>
  13744.  
  13745.  
  13746. card_35573.xml
  13747. <?xml version="1.0" encoding="utf-8" ?>
  13748. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13749. <card>
  13750.     <id>35573</id>
  13751.     <filler1>0</filler1>
  13752.     <cantDelete> <false /> </cantDelete>
  13753.     <showPict> <true /> </showPict>
  13754.     <dontSearch> <false /> </dontSearch>
  13755.     <owner>4755</owner>
  13756.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13757.     <content>
  13758.         <layer>background</layer>
  13759.         <id>4</id>
  13760.         <text><span class="style3">y a function pointer is called by using the </span><span class="style4">*</span><span class="style3"> ("that which is pointed to by") operator with the function pointer, although ANSI C allows the </span><span class="style4">*</span><span class="style3"> to be omitted(!).  The following function takes one function pointer and one float as arguments, and returns the result of applying the function pointed to by the function pointer twice.
  13761. </span><span class="style4">
  13762.     float  perform_twice(float (*func_ptr)(float),float value)
  13763.     {
  13764.         return (*func_ptr)((*func_ptr)(value));
  13765.     }
  13766.  
  13767. </span><span class="style3">The calling function passes the address of the desired function as an argument to the called function.  As with array identifiers, the function identifier itself represents its address ‚Äî the </span><span class="style4">&</span><span class="style3"> operator is not needed.  The calling function may pass the </span><span class="style4">square()</span><span class="style3"> function to </span><span class="style4">perform_twice()</span><span class="style3"> as an argument, in order to find the 4th power of a value:
  13768. </span><span class="style4">
  13769.     fourth_power = perform_twice(square,original_value);
  13770. </span></text>
  13771.     </content>
  13772.     <content>
  13773.         <layer>background</layer>
  13774.         <id>7</id>
  13775.         <text>109</text>
  13776.     </content>
  13777.     <name></name>
  13778.     <script></script>
  13779. </card>
  13780.  
  13781.  
  13782. card_31462.xml
  13783. <?xml version="1.0" encoding="utf-8" ?>
  13784. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13785. <card>
  13786.     <id>31462</id>
  13787.     <filler1>0</filler1>
  13788.     <cantDelete> <false /> </cantDelete>
  13789.     <showPict> <true /> </showPict>
  13790.     <dontSearch> <false /> </dontSearch>
  13791.     <owner>4755</owner>
  13792.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13793.     <content>
  13794.         <layer>background</layer>
  13795.         <id>4</id>
  13796.         <text><span class="style3">he C language has very few reserved words or built-in operators.  Rather, it relies upon the existence of function </span><span class="style7">libraries</span><span class="style3"> to empower the programmer.  The use of function libraries allows the C language to be customized for particular environments and application areas, contributing to its efficiency and flexibility.
  13797.  
  13798. ANSI C compilers include a standard function library which provides functions for mathematical operations, input/output, string handling, memory allocation, etc.  (Pre-ANSI C compilers often used separate libraries for these collections of functions.)  These functions may be accessed directly from any of the programmer's own functions, provided an appropriate declaration for the library function precedes its use in the source file.
  13799.  
  13800. The programmer should not declare the standard functions himself/herself.  Rather, the appropriate standard header files should be referenced, as discussed further in Chapters 7 and 8.  These header files themselves contain the declarations for the corresponding library functions.  In this way, the program is less likely to be affected by future changes to the function libraries.
  13801. </span></text>
  13802.     </content>
  13803.     <content>
  13804.         <layer>background</layer>
  13805.         <id>7</id>
  13806.         <text>110</text>
  13807.     </content>
  13808.     <content>
  13809.         <layer>background</layer>
  13810.         <id>6</id>
  13811.         <text>3.7  Library Functions</text>
  13812.     </content>
  13813.     <name></name>
  13814.     <script></script>
  13815. </card>
  13816.  
  13817.  
  13818. card_33418.xml
  13819. <?xml version="1.0" encoding="utf-8" ?>
  13820. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13821. <card>
  13822.     <id>33418</id>
  13823.     <filler1>0</filler1>
  13824.     <cantDelete> <false /> </cantDelete>
  13825.     <showPict> <true /> </showPict>
  13826.     <dontSearch> <false /> </dontSearch>
  13827.     <owner>4755</owner>
  13828.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13829.     <content>
  13830.         <layer>background</layer>
  13831.         <id>4</id>
  13832.         <text><span class="style3">or example, if the programmer uses the standard I/O function </span><span class="style4">printf()</span><span class="style3"> and the string copy function </span><span class="style4">strcpy()</span><span class="style3">, then the appropriate declarations for these functions are referenced by inserting the following instructions at the top of the source file:
  13833. </span><span class="style4">
  13834.     # include <stdio.h>
  13835.     # include <string.h>
  13836.  
  13837. </span><span class="style3">These preprocessor directives* cause the declarations contained in the header files </span><span class="style18">stdio.h</span><span class="style3"> and </span><span class="style18">string.h</span><span class="style3"> to be inserted into the programmer's source file.  Chapter 8 describes several useful standard functions and their header files.
  13838.  
  13839. Most environments provide additional specialized libraries and header files, and allow programmers to define new ones.  The compiler must be alerted which of these non-standard libraries is in use, so that it can locate the needed functions when linking the completed program.
  13840.  
  13841. Macintosh C compilers provide header files declaring the ROM "Toolbox" functions which enable the Macintosh interface, so they can be treated as a C function library.</span></text>
  13842.     </content>
  13843.     <content>
  13844.         <layer>background</layer>
  13845.         <id>7</id>
  13846.         <text>111</text>
  13847.     </content>
  13848.     <content>
  13849.         <layer>background</layer>
  13850.         <id>29</id>
  13851.         <text>52189</text>
  13852.     </content>
  13853.     <content>
  13854.         <layer>background</layer>
  13855.         <id>27</id>
  13856.         <text>File inclusion</text>
  13857.     </content>
  13858.     <content>
  13859.         <layer>background</layer>
  13860.         <id>20</id>
  13861.         <text>File inclusion - p199</text>
  13862.     </content>
  13863.     <content>
  13864.         <layer>background</layer>
  13865.         <id>17</id>
  13866.         <text>p223</text>
  13867.     </content>
  13868.     <name></name>
  13869.     <script></script>
  13870. </card>
  13871.  
  13872.  
  13873. card_7960.xml
  13874. <?xml version="1.0" encoding="utf-8" ?>
  13875. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13876. <card>
  13877.     <id>7960</id>
  13878.     <filler1>0</filler1>
  13879.     <cantDelete> <false /> </cantDelete>
  13880.     <showPict> <true /> </showPict>
  13881.     <dontSearch> <false /> </dontSearch>
  13882.     <owner>4755</owner>
  13883.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13884.     <content>
  13885.         <layer>background</layer>
  13886.         <id>6</id>
  13887.         <text>3.8  Example</text>
  13888.     </content>
  13889.     <content>
  13890.         <layer>background</layer>
  13891.         <id>4</id>
  13892.         <text><span class="style3">he scrolling text fields on the following two pages contain code which may be pasted into the source files </span><span class="style18">functest.c</span><span class="style3"> and </span><span class="style18">contchar.c</span><span class="style3">, and compiled.  This brief program demonstrates the use of recursion in string-handling functions and the use multiple source files.</span></text>
  13893.     </content>
  13894.     <content>
  13895.         <layer>background</layer>
  13896.         <id>7</id>
  13897.         <text>112</text>
  13898.     </content>
  13899.     <content>
  13900.         <layer>background</layer>
  13901.         <id>18</id>
  13902.         <text>p207</text>
  13903.     </content>
  13904.     <name></name>
  13905.     <script></script>
  13906. </card>
  13907.  
  13908.  
  13909. card_30088.xml
  13910. <?xml version="1.0" encoding="utf-8" ?>
  13911. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  13912. <card>
  13913.     <id>30088</id>
  13914.     <filler1>0</filler1>
  13915.     <cantDelete> <false /> </cantDelete>
  13916.     <showPict> <true /> </showPict>
  13917.     <dontSearch> <false /> </dontSearch>
  13918.     <owner>4755</owner>
  13919.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  13920.     <part>
  13921.         <id>1</id>
  13922.         <type>field</type>
  13923.         <visible> <true /> </visible>
  13924.         <dontWrap> <false /> </dontWrap>
  13925.         <dontSearch> <false /> </dontSearch>
  13926.         <sharedText> <false /> </sharedText>
  13927.         <fixedLineHeight> <true /> </fixedLineHeight>
  13928.         <autoTab> <false /> </autoTab>
  13929.         <lockText> <false /> </lockText>
  13930.         <rect>
  13931.             <left>30</left>
  13932.             <top>78</top>
  13933.             <right>478</right>
  13934.             <bottom>296</bottom>
  13935.         </rect>
  13936.         <style>scrolling</style>
  13937.         <autoSelect> <false /> </autoSelect>
  13938.         <showLines> <false /> </showLines>
  13939.         <wideMargins> <false /> </wideMargins>
  13940.         <multipleLines> <false /> </multipleLines>
  13941.         <reservedFamily> 0 </reservedFamily>
  13942.         <titleWidth>0</titleWidth>
  13943.         <icon>0</icon>
  13944.         <textAlign>left</textAlign>
  13945.         <font>Monaco</font>
  13946.         <textSize>9</textSize>
  13947.         <textStyle>plain</textStyle>
  13948.         <textHeight>12</textHeight>
  13949.         <name>code</name>
  13950.         <script></script>
  13951.     </part>
  13952.     <part>
  13953.         <id>2</id>
  13954.         <type>button</type>
  13955.         <visible> <true /> </visible>
  13956.         <reserved5> 0 </reserved5>
  13957.         <reserved4> 0 </reserved4>
  13958.         <reserved3> 0 </reserved3>
  13959.         <reserved2> 0 </reserved2>
  13960.         <reserved1> 0 </reserved1>
  13961.         <enabled> <true /> </enabled>
  13962.         <rect>
  13963.             <left>13</left>
  13964.             <top>29</top>
  13965.             <right>351</right>
  13966.             <bottom>57</bottom>
  13967.         </rect>
  13968.         <style>opaque</style>
  13969.         <showName> <false /> </showName>
  13970.         <highlight> <false /> </highlight>
  13971.         <autoHighlight> <false /> </autoHighlight>
  13972.         <sharedHighlight> <true /> </sharedHighlight>
  13973.         <family>0</family>
  13974.         <titleWidth>0</titleWidth>
  13975.         <icon>0</icon>
  13976.         <textAlign>center</textAlign>
  13977.         <font>Chicago</font>
  13978.         <textSize>12</textSize>
  13979.         <textStyle>plain</textStyle>
  13980.         <name>New Button</name>
  13981.         <script></script>
  13982.     </part>
  13983.     <part>
  13984.         <id>3</id>
  13985.         <type>button</type>
  13986.         <visible> <true /> </visible>
  13987.         <reserved5> 0 </reserved5>
  13988.         <reserved4> 0 </reserved4>
  13989.         <reserved3> 0 </reserved3>
  13990.         <reserved2> 0 </reserved2>
  13991.         <reserved1> 0 </reserved1>
  13992.         <enabled> <true /> </enabled>
  13993.         <rect>
  13994.             <left>169</left>
  13995.             <top>32</top>
  13996.             <right>305</right>
  13997.             <bottom>54</bottom>
  13998.         </rect>
  13999.         <style>roundrect</style>
  14000.         <showName> <true /> </showName>
  14001.         <highlight> <false /> </highlight>
  14002.         <autoHighlight> <true /> </autoHighlight>
  14003.         <sharedHighlight> <true /> </sharedHighlight>
  14004.         <family>0</family>
  14005.         <titleWidth>0</titleWidth>
  14006.         <icon>0</icon>
  14007.         <textAlign>center</textAlign>
  14008.         <font>Chicago</font>
  14009.         <textSize>12</textSize>
  14010.         <textStyle>plain</textStyle>
  14011.         <name>Copy to Clipboard</name>
  14012.         <script>on mouseUp
  14013. set lockscreen to true
  14014. select text of card field "code"
  14015. domenu "Copy Text"
  14016. select empty
  14017. set lockscreen to false
  14018. end mouseUp</script>
  14019.     </part>
  14020.     <content>
  14021.         <layer>card</layer>
  14022.         <id>1</id>
  14023.         <text>/*
  14024. *   FILE:    functest.c
  14025. *   AUTHOR:  R.G.
  14026. *   CREATED: June 22, 1990
  14027. *   
  14028. *   Program illustrating various function features.
  14029. *
  14030. *   PROJECT CONTENTS:
  14031. *   functest.c, contchar.c, ANSI library
  14032. */
  14033.  
  14034. # include <stdio.h>   /* declare standard I/O functions */
  14035.  
  14036. int  contains_char(char*,char);  /* declare function in other file */
  14037.  
  14038. /******************************************************************
  14039. *   main() function
  14040. ******************************************************************/
  14041. main()
  14042. {
  14043.     char  name[80],
  14044.           search_char,
  14045.           junk;
  14046.  
  14047.     printf("Enter your name (no spaces):\n");
  14048.     scanf("%s",name);
  14049.     scanf("%c",&junk);     /* get unneeded linefeed character */
  14050.     printf("Enter search character:\n");
  14051.     scanf("%c",&search_char);
  14052.  
  14053.     printf("Result: %d\n",contains_char(name,search_char));
  14054. }
  14055.  
  14056. </text>
  14057.     </content>
  14058.     <content>
  14059.         <layer>background</layer>
  14060.         <id>4</id>
  14061.         <text>File 1 of 2 demonstrating C functions:</text>
  14062.     </content>
  14063.     <content>
  14064.         <layer>background</layer>
  14065.         <id>6</id>
  14066.         <text>Example of recursion, multiple source files</text>
  14067.     </content>
  14068.     <content>
  14069.         <layer>background</layer>
  14070.         <id>7</id>
  14071.         <text>113</text>
  14072.     </content>
  14073.     <name></name>
  14074.     <script></script>
  14075. </card>
  14076.  
  14077.  
  14078. card_35660.xml
  14079. <?xml version="1.0" encoding="utf-8" ?>
  14080. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14081. <card>
  14082.     <id>35660</id>
  14083.     <filler1>0</filler1>
  14084.     <cantDelete> <false /> </cantDelete>
  14085.     <showPict> <true /> </showPict>
  14086.     <dontSearch> <false /> </dontSearch>
  14087.     <owner>4755</owner>
  14088.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14089.     <part>
  14090.         <id>1</id>
  14091.         <type>field</type>
  14092.         <visible> <true /> </visible>
  14093.         <dontWrap> <false /> </dontWrap>
  14094.         <dontSearch> <false /> </dontSearch>
  14095.         <sharedText> <false /> </sharedText>
  14096.         <fixedLineHeight> <true /> </fixedLineHeight>
  14097.         <autoTab> <false /> </autoTab>
  14098.         <lockText> <false /> </lockText>
  14099.         <rect>
  14100.             <left>30</left>
  14101.             <top>78</top>
  14102.             <right>478</right>
  14103.             <bottom>296</bottom>
  14104.         </rect>
  14105.         <style>scrolling</style>
  14106.         <autoSelect> <false /> </autoSelect>
  14107.         <showLines> <false /> </showLines>
  14108.         <wideMargins> <false /> </wideMargins>
  14109.         <multipleLines> <false /> </multipleLines>
  14110.         <reservedFamily> 0 </reservedFamily>
  14111.         <titleWidth>0</titleWidth>
  14112.         <icon>0</icon>
  14113.         <textAlign>left</textAlign>
  14114.         <font>Monaco</font>
  14115.         <textSize>9</textSize>
  14116.         <textStyle>plain</textStyle>
  14117.         <textHeight>12</textHeight>
  14118.         <name>code</name>
  14119.         <script></script>
  14120.     </part>
  14121.     <part>
  14122.         <id>2</id>
  14123.         <type>button</type>
  14124.         <visible> <true /> </visible>
  14125.         <reserved5> 0 </reserved5>
  14126.         <reserved4> 0 </reserved4>
  14127.         <reserved3> 0 </reserved3>
  14128.         <reserved2> 0 </reserved2>
  14129.         <reserved1> 0 </reserved1>
  14130.         <enabled> <true /> </enabled>
  14131.         <rect>
  14132.             <left>169</left>
  14133.             <top>32</top>
  14134.             <right>305</right>
  14135.             <bottom>54</bottom>
  14136.         </rect>
  14137.         <style>roundrect</style>
  14138.         <showName> <true /> </showName>
  14139.         <highlight> <false /> </highlight>
  14140.         <autoHighlight> <true /> </autoHighlight>
  14141.         <sharedHighlight> <true /> </sharedHighlight>
  14142.         <family>0</family>
  14143.         <titleWidth>0</titleWidth>
  14144.         <icon>0</icon>
  14145.         <textAlign>center</textAlign>
  14146.         <font>Chicago</font>
  14147.         <textSize>12</textSize>
  14148.         <textStyle>plain</textStyle>
  14149.         <name>Copy to Clipboard</name>
  14150.         <script>on mouseUp
  14151. set lockscreen to true
  14152. select text of card field "code"
  14153. domenu "Copy Text"
  14154. select empty
  14155. set lockscreen to false
  14156. end mouseUp</script>
  14157.     </part>
  14158.     <content>
  14159.         <layer>background</layer>
  14160.         <id>4</id>
  14161.         <text>File 2 of 2:</text>
  14162.     </content>
  14163.     <content>
  14164.         <layer>background</layer>
  14165.         <id>7</id>
  14166.         <text>114</text>
  14167.     </content>
  14168.     <content>
  14169.         <layer>card</layer>
  14170.         <id>1</id>
  14171.         <text>/*
  14172. *   FILE:    contchar.c
  14173. *   AUTHOR:  R.G.
  14174. *   CREATED: June 22, 1990
  14175. *   
  14176. *   Definition of contains_char().
  14177. */
  14178.  
  14179. /******************************************************************
  14180. *   Recursive function to look for ocurrence of a character in
  14181. *   a character string (array)
  14182. ******************************************************************/
  14183. int   contains_char(char *string,char c)
  14184. {
  14185.     /* recall that array name points to first element of array: */
  14186.     if (*string == '\0')    /* end of string encountered */
  14187.         return 0;           /* return false */
  14188.     else if (*string == c)  /* character found */
  14189.         return 1;           /* return true */
  14190.     else
  14191.         return contains_char(string+1,c);  /* look at rest of string */
  14192. }
  14193.  
  14194. </text>
  14195.     </content>
  14196.     <name></name>
  14197.     <script></script>
  14198. </card>
  14199.  
  14200.  
  14201. card_8871.xml
  14202. <?xml version="1.0" encoding="utf-8" ?>
  14203. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14204. <card>
  14205.     <id>8871</id>
  14206.     <filler1>0</filler1>
  14207.     <cantDelete> <false /> </cantDelete>
  14208.     <showPict> <true /> </showPict>
  14209.     <dontSearch> <false /> </dontSearch>
  14210.     <owner>4755</owner>
  14211.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14212.     <content>
  14213.         <layer>background</layer>
  14214.         <id>6</id>
  14215.         <text>4.  Classes & Program Structure </text>
  14216.     </content>
  14217.     <content>
  14218.         <layer>background</layer>
  14219.         <id>7</id>
  14220.         <text>115</text>
  14221.     </content>
  14222.     <content>
  14223.         <layer>background</layer>
  14224.         <id>4</id>
  14225.         <text><span class="style3">n </span><span class="style7">object</span><span class="style3"> is a variable which represents a collection of data (like a C </span><span class="style4">struct</span><span class="style3">*) and also represents the procedures which may act upon this data.  Structuring programming efforts according to appropriate objects (rather than functions or procedures) is said to improve problem analysis, by more closely modelling the real-world problem of interest.  This in turn aids program development, understandability, and maintenance.  It is possible to define an object using traditional C syntax, by encapsulating the data and related procedures in a separate source file.
  14226.  
  14227. Think C and C++ extend traditional C by providing new syntax for consistent definition of objects, and by allowing the definition of </span><span class="style7">classes</span><span class="style3"> of objects.  This promotes the object-oriented programming (OOP) approach, which in turn can lead to more concise and flexible (reusable) code.
  14228.  
  14229. This chapter describes the extensions provided by TC and C++, and discusses several programming considerations.  C++ provides several additional details for OOP which are not supported by TC.  These extensions will </span><span class="style7">not</span><span class="style3"> be detailed in this text, but are mentioned briefly where relevant and are summarized in Appendix 2.</span></text>
  14230.     </content>
  14231.     <content>
  14232.         <layer>background</layer>
  14233.         <id>29</id>
  14234.         <text>25150</text>
  14235.     </content>
  14236.     <content>
  14237.         <layer>background</layer>
  14238.         <id>27</id>
  14239.         <text>User-defined data structures</text>
  14240.     </content>
  14241.     <content>
  14242.         <layer>background</layer>
  14243.         <id>20</id>
  14244.         <text>User-defined data structures - p75</text>
  14245.     </content>
  14246.     <name></name>
  14247.     <script></script>
  14248. </card>
  14249.  
  14250.  
  14251. card_36058.xml
  14252. <?xml version="1.0" encoding="utf-8" ?>
  14253. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14254. <card>
  14255.     <id>36058</id>
  14256.     <filler1>0</filler1>
  14257.     <cantDelete> <false /> </cantDelete>
  14258.     <showPict> <true /> </showPict>
  14259.     <dontSearch> <false /> </dontSearch>
  14260.     <owner>4755</owner>
  14261.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14262.     <content>
  14263.         <layer>background</layer>
  14264.         <id>6</id>
  14265.         <text>4.1  Classes & Methods</text>
  14266.     </content>
  14267.     <content>
  14268.         <layer>background</layer>
  14269.         <id>4</id>
  14270.         <text><span class="style3">C/C++ supports OOP simply by extending the existing </span><span class="style4">struct</span><span class="style3"> user-defined type available in C.  The definition of a user-defined struct type is said to be a </span><span class="style7">class</span><span class="style3"> definition if function prototype declarations are included as members of the struct.  In this case, the members which are variable declarations are said to declare </span><span class="style7">instance variables</span><span class="style3"> and the "member function" declarations are said to declare the </span><span class="style7">methods</span><span class="style3"> which apply to these variables.  The following defines the </span><span class="style4">Person</span><span class="style3"> class, which declares </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables, and </span><span class="style4">set()</span><span class="style3"> and </span><span class="style4">print()</span><span class="style3"> methods:
  14271. </span><span class="style4">
  14272.     struct Person:indirect    // for C++ omit ':indirect' 
  14273.     {
  14274.         int       age;
  14275.         int       weight;
  14276.  
  14277.         virtual void    set(void);  
  14278.         virtual void    print(void); 
  14279.     };
  14280.  
  14281. </span><span class="style3">(A useful convention is to begin all class names with a capital letter.)
  14282.  
  14283. </span></text>
  14284.     </content>
  14285.     <content>
  14286.         <layer>background</layer>
  14287.         <id>7</id>
  14288.         <text>116</text>
  14289.     </content>
  14290.     <content>
  14291.         <layer>background</layer>
  14292.         <id>17</id>
  14293.         <text>p210</text>
  14294.     </content>
  14295.     <name></name>
  14296.     <script></script>
  14297. </card>
  14298.  
  14299.  
  14300. card_36204.xml
  14301. <?xml version="1.0" encoding="utf-8" ?>
  14302. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14303. <card>
  14304.     <id>36204</id>
  14305.     <filler1>0</filler1>
  14306.     <cantDelete> <false /> </cantDelete>
  14307.     <showPict> <true /> </showPict>
  14308.     <dontSearch> <false /> </dontSearch>
  14309.     <owner>4755</owner>
  14310.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14311.     <content>
  14312.         <layer>background</layer>
  14313.         <id>4</id>
  14314.         <text><span class="style3">he </span><span class="style4">indirect</span><span class="style3"> specifier indicates how TC implements objects of this class, and is discussed later.*  It is not used in C++.  The </span><span class="style4">virtual</span><span class="style3"> specifier identifies the </span><span class="style4">set()</span><span class="style3"> and </span><span class="style4">print()</span><span class="style3"> methods as "virtual" methods, whose significance will be seen later.**
  14315.  
  14316. The </span><span class="style4">set()</span><span class="style3"> and </span><span class="style4">print()</span><span class="style3"> methods are defined using the new </span><span class="style7">scope resolution</span><span class="style3"> operator, </span><span class="style4">::</span><span class="style3">.  This associates the function definitions with the appropriate class.  For example:
  14317. </span><span class="style4">
  14318.     void    Person::set(void)
  14319.     {
  14320.         age = 62;
  14321.         weight = 155;
  14322.     }
  14323.  
  14324. </span><span class="style3">The instance variables declared in the </span><span class="style4">Person</span><span class="style3"> class are accessible from within the body of the member function definitions without need for the dot or </span><span class="style4">-></span><span class="style3"> operators usually needed to access structure members.  However, if a method definition uses a local variable with the same identifier as an instance variable, the instance variable can be accessed using the automatically-declared </span><span class="style4">this</span><span class="style3"> pointer, e.g.:  </span><span class="style4">this->age = 62</span><span class="style3">.
  14325.  
  14326.  
  14327.  
  14328.  
  14329. </span></text>
  14330.     </content>
  14331.     <content>
  14332.         <layer>background</layer>
  14333.         <id>7</id>
  14334.         <text>117</text>
  14335.     </content>
  14336.     <content>
  14337.         <layer>background</layer>
  14338.         <id>29</id>
  14339.         <text>38494
  14340. 43887</text>
  14341.     </content>
  14342.     <content>
  14343.         <layer>background</layer>
  14344.         <id>27</id>
  14345.         <text>Macintosh memory management
  14346. Virtual methods</text>
  14347.     </content>
  14348.     <content>
  14349.         <layer>background</layer>
  14350.         <id>20</id>
  14351.         <text>Macintosh memory management - p158</text>
  14352.     </content>
  14353.     <content>
  14354.         <layer>background</layer>
  14355.         <id>23</id>
  14356.         <text>Virtual methods - p128</text>
  14357.     </content>
  14358.     <name></name>
  14359.     <script></script>
  14360. </card>
  14361.  
  14362.  
  14363. card_36371.xml
  14364. <?xml version="1.0" encoding="utf-8" ?>
  14365. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14366. <card>
  14367.     <id>36371</id>
  14368.     <filler1>0</filler1>
  14369.     <cantDelete> <false /> </cantDelete>
  14370.     <showPict> <true /> </showPict>
  14371.     <dontSearch> <false /> </dontSearch>
  14372.     <owner>4755</owner>
  14373.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14374.     <content>
  14375.         <layer>background</layer>
  14376.         <id>4</id>
  14377.         <text><span class="style3">ERIVED CLASSES
  14378.  
  14379. An important object-oriented technique is that of deriving new classes from existing classes.  A derived class (descendant, child or subclass) is one which </span><span class="style7">inherits</span><span class="style3"> the instance variable and method declarations of the base class (ancestor, parent or superclass), and adds instance variables and methods of its own.  A derived class may also provide new definitions for the methods declared in the base class, in which case the new definition is said to "override" the original.  (If the original method was "virtual", then there is no need to use the </span><span class="style4">virtual</span><span class="style3"> keyword when overriding the method.)  The syntax to derive the </span><span class="style4">Student</span><span class="style3"> class from the </span><span class="style4">Person</span><span class="style3"> class is:
  14380. </span><span class="style4">
  14381.     struct  Student:Person
  14382.     {
  14383.         int    student_num;     // additional instance variable 
  14384.         
  14385.         void    set(void);      // override original set() method 
  14386.         void    print(void);    // override original print() method 
  14387.     };</span></text>
  14388.     </content>
  14389.     <content>
  14390.         <layer>background</layer>
  14391.         <id>7</id>
  14392.         <text>118</text>
  14393.     </content>
  14394.     <content>
  14395.         <layer>background</layer>
  14396.         <id>17</id>
  14397.         <text>p202</text>
  14398.     </content>
  14399.     <name></name>
  14400.     <script></script>
  14401. </card>
  14402.  
  14403.  
  14404. card_36702.xml
  14405. <?xml version="1.0" encoding="utf-8" ?>
  14406. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14407. <card>
  14408.     <id>36702</id>
  14409.     <filler1>0</filler1>
  14410.     <cantDelete> <false /> </cantDelete>
  14411.     <showPict> <true /> </showPict>
  14412.     <dontSearch> <false /> </dontSearch>
  14413.     <owner>4755</owner>
  14414.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14415.     <content>
  14416.         <layer>background</layer>
  14417.         <id>4</id>
  14418.         <text><span class="style3">ince it is derived from the </span><span class="style4">Person</span><span class="style3"> class, the </span><span class="style4">Student</span><span class="style3"> class implicitly declares </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables as well.  It is necessary to redefine any  methods which were redeclared in the new class definition, for example:
  14419. </span><span class="style4">
  14420.     void    Student::set(void)
  14421.     {
  14422.         student_num = 12345;
  14423.         Person::set();   
  14424.     }
  14425.  
  14426. </span><span class="style3">The </span><span class="style4">Person::set()</span><span class="style3"> syntax invokes the </span><span class="style4">set()</span><span class="style3"> method of the base class*, which itself assigns values to the inherited </span><span class="style4">age</span><span class="style3"> and </span><span class="style4">weight</span><span class="style3"> instance variables.  In Think C an alternative syntax (not available in C++) may be used: </span><span class="style4"> inherited::set()</span><span class="style3">.
  14427.  
  14428. It is possible to derive additional classes from the </span><span class="style4">Student</span><span class="style3"> class to obtain still more-specialized classes.  In fact, it is customary to derive </span><span class="style7">all</span><span class="style3"> classes in an application from a single class and its descendants, creating a hierarchy or "tree".  For the remainder of this chapter we will use the class </span><span class="style4">Generic_Class</span><span class="style3"> as this "root" class:
  14429.  
  14430. </span></text>
  14431.     </content>
  14432.     <content>
  14433.         <layer>background</layer>
  14434.         <id>7</id>
  14435.         <text>119</text>
  14436.     </content>
  14437.     <content>
  14438.         <layer>background</layer>
  14439.         <id>29</id>
  14440.         <text>38674</text>
  14441.     </content>
  14442.     <content>
  14443.         <layer>background</layer>
  14444.         <id>27</id>
  14445.         <text>Invoking methods from within other methods</text>
  14446.     </content>
  14447.     <content>
  14448.         <layer>background</layer>
  14449.         <id>20</id>
  14450.         <text>Invoking methods from within other methods - p125</text>
  14451.     </content>
  14452.     <content>
  14453.         <layer>background</layer>
  14454.         <id>17</id>
  14455.         <text>p189</text>
  14456.     </content>
  14457.     <name></name>
  14458.     <script></script>
  14459. </card>
  14460.  
  14461.  
  14462. card_37092.xml
  14463. <?xml version="1.0" encoding="utf-8" ?>
  14464. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14465. <card>
  14466.     <id>37092</id>
  14467.     <filler1>0</filler1>
  14468.     <cantDelete> <false /> </cantDelete>
  14469.     <showPict> <true /> </showPict>
  14470.     <dontSearch> <false /> </dontSearch>
  14471.     <owner>4755</owner>
  14472.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14473.     <content>
  14474.         <layer>background</layer>
  14475.         <id>4</id>
  14476.         <text><span class="style4">   typedef  int   boolean;
  14477.  
  14478.     struct   Generic_Class:indirect    // for C++ omit ':indirect' 
  14479.     {
  14480.         boolean            initialized;    
  14481.         virtual boolean    is_initialized(void); 
  14482.     };
  14483.  
  14484.     boolean  Generic_Class::is_initialized(void)
  14485.     {
  14486.         return initialized;
  14487.     }
  14488.  
  14489. </span><span class="style3">The </span><span class="style4">is_initialized()</span><span class="style3"> method will thus be inherited by all classes.  Its use will be discussed later.*  (The </span><span class="style4">boolean</span><span class="style3"> data type represents "true" and "false" values only, and is defined a synonym for </span><span class="style4">int</span><span class="style3"> using </span><span class="style4">typedef</span><span class="style3">.</span><span class="style4">**</span><span class="style3">)
  14490.  
  14491. Let's redefine the </span><span class="style4">Person</span><span class="style3"> class to be derived from the </span><span class="style4">Generic_Class</span><span class="style3">:
  14492. </span><span class="style4">
  14493. </span><span class="style3">
  14494. </span></text>
  14495.     </content>
  14496.     <content>
  14497.         <layer>background</layer>
  14498.         <id>7</id>
  14499.         <text>120</text>
  14500.     </content>
  14501.     <content>
  14502.         <layer>background</layer>
  14503.         <id>27</id>
  14504.         <text>Constructors
  14505. Using typedef
  14506. </text>
  14507.     </content>
  14508.     <content>
  14509.         <layer>background</layer>
  14510.         <id>29</id>
  14511.         <text>43696
  14512. 26498
  14513. </text>
  14514.     </content>
  14515.     <content>
  14516.         <layer>background</layer>
  14517.         <id>20</id>
  14518.         <text>Constructors - p133</text>
  14519.     </content>
  14520.     <content>
  14521.         <layer>background</layer>
  14522.         <id>23</id>
  14523.         <text>Using typedef - p79</text>
  14524.     </content>
  14525.     <name></name>
  14526.     <script></script>
  14527. </card>
  14528.  
  14529.  
  14530. card_37863.xml
  14531. <?xml version="1.0" encoding="utf-8" ?>
  14532. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14533. <card>
  14534.     <id>37863</id>
  14535.     <filler1>0</filler1>
  14536.     <cantDelete> <false /> </cantDelete>
  14537.     <showPict> <true /> </showPict>
  14538.     <dontSearch> <false /> </dontSearch>
  14539.     <owner>4755</owner>
  14540.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14541.     <content>
  14542.         <layer>background</layer>
  14543.         <id>4</id>
  14544.         <text><span class="style4">   struct Person:Generic_Class
  14545.     {
  14546.         int       age;
  14547.         int       weight;
  14548.  
  14549.         virtual void    set(void); 
  14550.         virtual void    print(void);  
  14551.     };
  14552.  
  14553. </span><span class="style3">Now both the </span><span class="style4">Person</span><span class="style3"> and </span><span class="style4">Student</span><span class="style3"> classes inherit the </span><span class="style4">is_initialized()</span><span class="style3"> method.
  14554.  
  14555. To clarify program structure, ease code reusability, and speed up development (via separate compilation), it is customary to place the definition of each class in a separate header file* and to place the definitions for a given class' methods in a separate source file.  This will be demonstrated in the example later in this chapter.</span></text>
  14556.     </content>
  14557.     <content>
  14558.         <layer>background</layer>
  14559.         <id>7</id>
  14560.         <text>121</text>
  14561.     </content>
  14562.     <content>
  14563.         <layer>background</layer>
  14564.         <id>29</id>
  14565.         <text>52189</text>
  14566.     </content>
  14567.     <content>
  14568.         <layer>background</layer>
  14569.         <id>27</id>
  14570.         <text>File inclusion</text>
  14571.     </content>
  14572.     <content>
  14573.         <layer>background</layer>
  14574.         <id>20</id>
  14575.         <text>File inclusion - p199</text>
  14576.     </content>
  14577.     <content>
  14578.         <layer>background</layer>
  14579.         <id>17</id>
  14580.         <text>p189</text>
  14581.     </content>
  14582.     <name></name>
  14583.     <script></script>
  14584. </card>
  14585.  
  14586.  
  14587. card_37143.xml
  14588. <?xml version="1.0" encoding="utf-8" ?>
  14589. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14590. <card>
  14591.     <id>37143</id>
  14592.     <filler1>0</filler1>
  14593.     <cantDelete> <false /> </cantDelete>
  14594.     <showPict> <true /> </showPict>
  14595.     <dontSearch> <false /> </dontSearch>
  14596.     <owner>4755</owner>
  14597.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14598.     <content>
  14599.         <layer>background</layer>
  14600.         <id>6</id>
  14601.         <text>4.2  Objects & Messages</text>
  14602.     </content>
  14603.     <content>
  14604.         <layer>background</layer>
  14605.         <id>4</id>
  14606.         <text><span class="style3">hus far we have not declared any variables whose type is a class.  Such variables are called </span><span class="style7">objects</span><span class="style3">.  In TC (but not in C++) it is illegal to declare an identifier which is itself an object.  Rather, we must declare an identifier which is a pointer to an object of the desired class.  This pointer will be called the </span><span class="style7">object reference</span><span class="style3">.  Generally, we will not bother to indicate in its name that it is a pointer (e.g.  </span><span class="style4">float *f_ptr</span><span class="style3">).  In fact, we will often speak of the object reference as though it were the object itself.
  14607. </span><span class="style4">
  14608.     Student  *jack;       // note: 'struct Student' is not needed 
  14609.  
  14610. </span><span class="style3">Recall that defining a pointer to a data type allocates space only for a machine address; it does not allocate space for a variable of this type ‚Äî in this case a </span><span class="style4">Student</span><span class="style3"> object ‚Äî itself.  The </span><span class="style4">new</span><span class="style3"> operator allocates space for the instance variables of an object of the specified class and returns a pointer to this space.
  14611. </span><span class="style4">
  14612.     jack = new Student; 
  14613.  
  14614. </span><span class="style3">Unlike the case with variables having "automatic" storage class*, space allocated by the </span><span class="style4">new</span><span class="style3"> operator is not deallocated upon completion of the function in which it is 
  14615. </span></text>
  14616.     </content>
  14617.     <content>
  14618.         <layer>background</layer>
  14619.         <id>29</id>
  14620.         <text>28174</text>
  14621.     </content>
  14622.     <content>
  14623.         <layer>background</layer>
  14624.         <id>27</id>
  14625.         <text>Automatic storage</text>
  14626.     </content>
  14627.     <content>
  14628.         <layer>background</layer>
  14629.         <id>20</id>
  14630.         <text>Automatic storage - p86</text>
  14631.     </content>
  14632.     <content>
  14633.         <layer>background</layer>
  14634.         <id>7</id>
  14635.         <text>122</text>
  14636.     </content>
  14637.     <content>
  14638.         <layer>background</layer>
  14639.         <id>17</id>
  14640.         <text>p189</text>
  14641.     </content>
  14642.     <name></name>
  14643.     <script></script>
  14644. </card>
  14645.  
  14646.  
  14647. card_37607.xml
  14648. <?xml version="1.0" encoding="utf-8" ?>
  14649. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14650. <card>
  14651.     <id>37607</id>
  14652.     <filler1>0</filler1>
  14653.     <cantDelete> <false /> </cantDelete>
  14654.     <showPict> <true /> </showPict>
  14655.     <dontSearch> <false /> </dontSearch>
  14656.     <owner>4755</owner>
  14657.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14658.     <content>
  14659.         <layer>background</layer>
  14660.         <id>4</id>
  14661.         <text><span class="style3">llocated.  Rather, such "free-store" variables must be deallocated explicitly by the programmer as discussed below.  (Notice that the object reference will often have automatic storage.  This means that if the function terminates before the object is explicitly deallocated, then the object reference will be deallocated and the program may no longer be able to access or reclaim the space occupied by the object.)
  14662.  
  14663. Since </span><span class="style4">jack</span><span class="style3"> is a pointer, the </span><span class="style4">-></span><span class="style3"> operator may be used to access the members of the object to which </span><span class="style4">jack</span><span class="style3"> points, in the same way as for traditional C structures.
  14664. </span><span class="style4">
  14665.     jack->age = 19;
  14666.  
  14667. </span><span class="style3">The scope of the instance variables is the same as the scope of the object reference, except that (as mentioned in the previous section) the instance variables may also be accessed from within the definitions of methods for this class, without need for the </span><span class="style4">-></span><span class="style3"> operator.  The instance variables are said to have </span><span class="style7">class scope</span><span class="style3">.
  14668.  
  14669.  
  14670. </span></text>
  14671.     </content>
  14672.     <content>
  14673.         <layer>background</layer>
  14674.         <id>7</id>
  14675.         <text>123</text>
  14676.     </content>
  14677.     <content>
  14678.         <layer>background</layer>
  14679.         <id>17</id>
  14680.         <text>p189</text>
  14681.     </content>
  14682.     <name></name>
  14683.     <script></script>
  14684. </card>
  14685.  
  14686.  
  14687. card_38203.xml
  14688. <?xml version="1.0" encoding="utf-8" ?>
  14689. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14690. <card>
  14691.     <id>38203</id>
  14692.     <filler1>0</filler1>
  14693.     <cantDelete> <false /> </cantDelete>
  14694.     <showPict> <true /> </showPict>
  14695.     <dontSearch> <false /> </dontSearch>
  14696.     <owner>4755</owner>
  14697.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14698.     <content>
  14699.         <layer>background</layer>
  14700.         <id>4</id>
  14701.         <text><span class="style3">ENDING MESSAGES
  14702.  
  14703. In fact, it is considered bad practice to access the instance variables of an object outside of the method definitions.  Rather, all communication with the object should generally be accomplished by calling its methods, or ‚Äî in OOP terminology ‚Äî sending it </span><span class="style7">messages</span><span class="style3">:
  14704. </span><span class="style4">
  14705.     jack->set();
  14706.     jack->print();
  14707.  
  14708. </span><span class="style3">By restricting access in this way, the implementation of the instance variables may later be changed, along with the appropriate methods, without affecting the functions which declare and use objects of this class.  As will be seen later in this chapter, access specifiers may be used to enforce this restriction.
  14709.  
  14710. Notice that in order to send a </span><span class="style4">print</span><span class="style3"> message you must refer to the identifier </span><span class="style4">jack</span><span class="style3">, which is a pointer to an object of this class.  In effect the scope of the </span><span class="style4">print()</span><span class="style3"> method 
  14711.  
  14712. </span></text>
  14713.     </content>
  14714.     <content>
  14715.         <layer>background</layer>
  14716.         <id>7</id>
  14717.         <text>124</text>
  14718.     </content>
  14719.     <content>
  14720.         <layer>background</layer>
  14721.         <id>17</id>
  14722.         <text>p189</text>
  14723.     </content>
  14724.     <name></name>
  14725.     <script></script>
  14726. </card>
  14727.  
  14728.  
  14729. card_38674.xml
  14730. <?xml version="1.0" encoding="utf-8" ?>
  14731. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14732. <card>
  14733.     <id>38674</id>
  14734.     <filler1>0</filler1>
  14735.     <cantDelete> <false /> </cantDelete>
  14736.     <showPict> <true /> </showPict>
  14737.     <dontSearch> <false /> </dontSearch>
  14738.     <owner>4755</owner>
  14739.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14740.     <content>
  14741.         <layer>background</layer>
  14742.         <id>4</id>
  14743.         <text><span class="style3">s restricted to the scope of the object reference.  As is the case with variables having class scope, </span><span class="style4">print()</span><span class="style3"> may also be invoked from within another method which belongs to the same class.  In this case the object reference may be omitted as it is when referring to instance variables from within the method.
  14744.  
  14745. For example, we may wish to immediately print the values of instance variables set in the </span><span class="style4">Student::set()</span><span class="style3"> method, by sending a </span><span class="style4">print</span><span class="style3"> message:
  14746. </span><span class="style4">
  14747.     void    Student::set(void)
  14748.     {
  14749.         student_num = 12345;
  14750.         Person::set();   
  14751.         print();
  14752.     }
  14753.  
  14754. </span><span class="style3">This is equivalent to:
  14755.  
  14756. </span><span class="style4">
  14757. </span></text>
  14758.     </content>
  14759.     <content>
  14760.         <layer>background</layer>
  14761.         <id>7</id>
  14762.         <text>125</text>
  14763.     </content>
  14764.     <content>
  14765.         <layer>background</layer>
  14766.         <id>29</id>
  14767.         <text>36702</text>
  14768.     </content>
  14769.     <content>
  14770.         <layer>background</layer>
  14771.         <id>27</id>
  14772.         <text>Previous definition of Student::set()</text>
  14773.     </content>
  14774.     <content>
  14775.         <layer>background</layer>
  14776.         <id>20</id>
  14777.         <text>Previous definition of Student::set() - p119</text>
  14778.     </content>
  14779.     <content>
  14780.         <layer>background</layer>
  14781.         <id>17</id>
  14782.         <text>p189</text>
  14783.     </content>
  14784.     <name></name>
  14785.     <script></script>
  14786. </card>
  14787.  
  14788.  
  14789. card_38944.xml
  14790. <?xml version="1.0" encoding="utf-8" ?>
  14791. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14792. <card>
  14793.     <id>38944</id>
  14794.     <filler1>0</filler1>
  14795.     <cantDelete> <false /> </cantDelete>
  14796.     <showPict> <true /> </showPict>
  14797.     <dontSearch> <false /> </dontSearch>
  14798.     <owner>4755</owner>
  14799.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14800.     <content>
  14801.         <layer>background</layer>
  14802.         <id>4</id>
  14803.         <text><span class="style4">   void    Student::set(void)
  14804.     {
  14805.         this->student_num = 12345;
  14806.         this->Person::set();   
  14807.         this->print();
  14808.     }
  14809.  
  14810. </span><span class="style3">where the </span><span class="style4">this</span><span class="style3"> identifier is an automatically-declared object reference to the "object which received the message."
  14811.  
  14812. As mentioned in the previous section, </span><span class="style4">Person::set()</span><span class="style3"> invokes the </span><span class="style4">set()</span><span class="style3"> method defined for the </span><span class="style4">Person</span><span class="style3"> class, which is an ancestor of the </span><span class="style4">Student</span><span class="style3"> class.  The methods of ancestral classes may be accessed through an object reference (including the </span><span class="style4">this</span><span class="style3"> object reference), provided they were not given the </span><span class="style4">private</span><span class="style3"> access specifier to be discussed later in this chapter.
  14813.  
  14814. </span></text>
  14815.     </content>
  14816.     <content>
  14817.         <layer>background</layer>
  14818.         <id>7</id>
  14819.         <text>126</text>
  14820.     </content>
  14821.     <content>
  14822.         <layer>background</layer>
  14823.         <id>17</id>
  14824.         <text>p189</text>
  14825.     </content>
  14826.     <name></name>
  14827.     <script></script>
  14828. </card>
  14829.  
  14830.  
  14831. card_64952.xml
  14832. <?xml version="1.0" encoding="utf-8" ?>
  14833. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14834. <card>
  14835.     <id>64952</id>
  14836.     <filler1>0</filler1>
  14837.     <cantDelete> <false /> </cantDelete>
  14838.     <showPict> <true /> </showPict>
  14839.     <dontSearch> <false /> </dontSearch>
  14840.     <owner>4755</owner>
  14841.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14842.     <content>
  14843.         <layer>background</layer>
  14844.         <id>4</id>
  14845.         <text><span class="style3">EALLOCATING OBJECTS
  14846.  
  14847. The space pointed to by an object reference must be deallocated by the programmer once the object is no longer needed.  This is done with the converse of the </span><span class="style4">new</span><span class="style3"> operator: the </span><span class="style4">delete</span><span class="style3"> operator.  It simply deallocates the object pointed to by its operand.
  14848. </span><span class="style4">
  14849.     delete jack; 
  14850.  
  14851. </span><span class="style3">The object reference </span><span class="style4">jack</span><span class="style3"> is not itself deallocated; only the space to which it points.  At this point, sending a message to </span><span class="style4">jack</span><span class="style3"> is likely to cause the program to crash:
  14852. </span><span class="style4">
  14853.     jack->set();    // will probably cause a crash if jack has been deleted!
  14854.  
  14855. </span><span class="style3">If </span><span class="style4">jack</span><span class="style3"> was never allocated (using the </span><span class="style4">new</span><span class="style3"> operator) at all, then it is also possible to crash the program simply by applying the </span><span class="style4">delete</span><span class="style3"> operator to </span><span class="style4">jack</span><span class="style3">.  This problem can be avoided by initializing the object reference </span><span class="style4">jack</span><span class="style3"> to the </span><span class="style4">NULL</span><span class="style3"> pointer.*  Applying the </span><span class="style4">delete</span><span class="style3"> operator to </span><span class="style4">NULL</span><span class="style3"> has no effect.
  14856.  
  14857.  
  14858.  
  14859.  
  14860. </span></text>
  14861.     </content>
  14862.     <content>
  14863.         <layer>background</layer>
  14864.         <id>29</id>
  14865.         <text>69591</text>
  14866.     </content>
  14867.     <content>
  14868.         <layer>background</layer>
  14869.         <id>27</id>
  14870.         <text>NULL pointer</text>
  14871.     </content>
  14872.     <content>
  14873.         <layer>background</layer>
  14874.         <id>20</id>
  14875.         <text>NULL pointer - p67</text>
  14876.     </content>
  14877.     <content>
  14878.         <layer>background</layer>
  14879.         <id>7</id>
  14880.         <text>127</text>
  14881.     </content>
  14882.     <name></name>
  14883.     <script></script>
  14884. </card>
  14885.  
  14886.  
  14887. card_43887.xml
  14888. <?xml version="1.0" encoding="utf-8" ?>
  14889. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14890. <card>
  14891.     <id>43887</id>
  14892.     <filler1>0</filler1>
  14893.     <cantDelete> <false /> </cantDelete>
  14894.     <showPict> <true /> </showPict>
  14895.     <dontSearch> <false /> </dontSearch>
  14896.     <owner>4755</owner>
  14897.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14898.     <content>
  14899.         <layer>background</layer>
  14900.         <id>4</id>
  14901.         <text><span class="style3">t is legal in TC/C++ to assign a pointer for an object of one class to a pointer for a </span><span class="style7">base</span><span class="style3"> class.  For example, if the </span><span class="style4">Student</span><span class="style3"> class is a descendant of the </span><span class="style4">Person</span><span class="style3"> class, you may declare an object reference which is a </span><span class="style4">Person</span><span class="style3"> pointer, and assign a </span><span class="style4">Student</span><span class="style3"> pointer to this object reference.
  14902.  
  14903. C is a </span><span class="style7">strongly-typed</span><span class="style3"> language.  The compiler makes use of the known (at compile-time) type of a value to generate code which will handle it correctly.  Therefore, it is the compile-time type of the object reference which is important, not the run-time type of the pointer assigned to this reference.  For example, suppose the </span><span class="style4">Student</span><span class="style3"> class has a new instance variable </span><span class="style4">id_number</span><span class="style3">:
  14904. </span><span class="style4">
  14905.     Person   *person;
  14906.     person = new Student;
  14907.     person->age = 18;            //ok so far
  14908.     person->id_number = 123;     // compilation error: "no such member"
  14909.  
  14910. </span><span class="style3">A compilation error occurs in the fourth line because the compiler still thinks </span><span class="style4">person</span><span class="style3"> is a reference to a </span><span class="style4">Person</span><span class="style3"> object, which wouldn't have an </span><span class="style4">id_number</span><span class="style3"> member.  (The 
  14911. </span></text>
  14912.     </content>
  14913.     <content>
  14914.         <layer>background</layer>
  14915.         <id>7</id>
  14916.         <text>128</text>
  14917.     </content>
  14918.     <content>
  14919.         <layer>background</layer>
  14920.         <id>6</id>
  14921.         <text>4.3  Virtual Methods and Typing</text>
  14922.     </content>
  14923.     <content>
  14924.         <layer>background</layer>
  14925.         <id>17</id>
  14926.         <text>p66</text>
  14927.     </content>
  14928.     <name></name>
  14929.     <script></script>
  14930. </card>
  14931.  
  14932.  
  14933. card_67716.xml
  14934. <?xml version="1.0" encoding="utf-8" ?>
  14935. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14936. <card>
  14937.     <id>67716</id>
  14938.     <filler1>0</filler1>
  14939.     <cantDelete> <false /> </cantDelete>
  14940.     <showPict> <true /> </showPict>
  14941.     <dontSearch> <false /> </dontSearch>
  14942.     <owner>4755</owner>
  14943.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  14944.     <content>
  14945.         <layer>background</layer>
  14946.         <id>4</id>
  14947.         <text><span class="style3">roblem vanishes when the first line is: "</span><span class="style4">Student *person</span><span class="style3">", or when a cast* is used.)
  14948. </span><span class="style4">
  14949. </span><span class="style3">However, TC/C++ contains a mechanism to determine the type of an object at run-time, for the sole purpose of invoking the correct method when a message is sent to this object.  This mechanism is used only for </span><span class="style7">virtual methods</span><span class="style3">.  A virtual method is one which was declared with the </span><span class="style4">virtual</span><span class="style3"> specifier, or one which descends from a virtual method.  For example:
  14950. </span><span class="style4">
  14951.     struct A:Generic_Class
  14952.     {
  14953.         void         m1(void);
  14954.         virtual void m2(void);
  14955.         virtual void m3(void);
  14956.     };
  14957.  
  14958.     struct B:A
  14959.     {
  14960.         void         m1(void);
  14961.         virtual void m2(void);  // 'virtual' here is optional, but good style
  14962.     };
  14963.  
  14964. </span></text>
  14965.     </content>
  14966.     <content>
  14967.         <layer>background</layer>
  14968.         <id>7</id>
  14969.         <text>129</text>
  14970.     </content>
  14971.     <content>
  14972.         <layer>background</layer>
  14973.         <id>17</id>
  14974.         <text>p66</text>
  14975.     </content>
  14976.     <content>
  14977.         <layer>background</layer>
  14978.         <id>29</id>
  14979.         <text>69198</text>
  14980.     </content>
  14981.     <content>
  14982.         <layer>background</layer>
  14983.         <id>27</id>
  14984.         <text>Casts for identifying objects</text>
  14985.     </content>
  14986.     <content>
  14987.         <layer>background</layer>
  14988.         <id>20</id>
  14989.         <text>Casts for identifying objects - p131</text>
  14990.     </content>
  14991.     <name></name>
  14992.     <script></script>
  14993. </card>
  14994.  
  14995.  
  14996. card_68019.xml
  14997. <?xml version="1.0" encoding="utf-8" ?>
  14998. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  14999. <card>
  15000.     <id>68019</id>
  15001.     <filler1>0</filler1>
  15002.     <cantDelete> <false /> </cantDelete>
  15003.     <showPict> <true /> </showPict>
  15004.     <dontSearch> <false /> </dontSearch>
  15005.     <owner>4755</owner>
  15006.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15007.     <content>
  15008.         <layer>background</layer>
  15009.         <id>4</id>
  15010.         <text><span class="style3">We assume the bodies of the </span><span class="style4">A::m1()</span><span class="style3">, </span><span class="style4">A::m2()</span><span class="style3">, </span><span class="style4">A::m3()</span><span class="style3">, </span><span class="style4">B::m1()</span><span class="style3">, and </span><span class="style4">B::m2()</span><span class="style3"> methods are defined elsewhere.)  Now we declare a reference to an </span><span class="style4">A</span><span class="style3"> object, and assign it a newly-allocated </span><span class="style4">B</span><span class="style3"> object:
  15011. </span><span class="style4">
  15012.     A    *a;
  15013.     a = new B;
  15014.     a->m1();
  15015.     a->m2();
  15016.     a->m3();
  15017.  
  15018. </span><span class="style3">The first method carried out is </span><span class="style4">A::m1()</span><span class="style3">, since the compile-time type of the object reference </span><span class="style4">a</span><span class="style3"> is </span><span class="style4">A</span><span class="style3">.  However, the second method carried out is </span><span class="style4">B::m2()</span><span class="style3">, since </span><span class="style4">m2</span><span class="style3"> is a virtual method and the run-time type of the object pointed to by </span><span class="style4">a</span><span class="style3"> is </span><span class="style4">B</span><span class="style3">.  The third method carried out is </span><span class="style4">A::m3()</span><span class="style3"> since it is simply inherited by the </span><span class="style4">B</span><span class="style3"> class.
  15019. </span><span class="style4">
  15020. </span><span class="style3">It is common to declare almost all methods as virtual, to encourage </span><span class="style7">polymorphism</span><span class="style3">: the property whereby the same message may be sent to various objects with the results appropriate to each.  In fact, Think C provides a "Methods are virtual by default" compilation option.</span><span class="style4">
  15021. </span></text>
  15022.     </content>
  15023.     <content>
  15024.         <layer>background</layer>
  15025.         <id>7</id>
  15026.         <text>130</text>
  15027.     </content>
  15028.     <content>
  15029.         <layer>background</layer>
  15030.         <id>17</id>
  15031.         <text>p66</text>
  15032.     </content>
  15033.     <name></name>
  15034.     <script></script>
  15035. </card>
  15036.  
  15037.  
  15038. card_69198.xml
  15039. <?xml version="1.0" encoding="utf-8" ?>
  15040. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15041. <card>
  15042.     <id>69198</id>
  15043.     <filler1>0</filler1>
  15044.     <cantDelete> <false /> </cantDelete>
  15045.     <showPict> <true /> </showPict>
  15046.     <dontSearch> <false /> </dontSearch>
  15047.     <owner>4755</owner>
  15048.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15049.     <content>
  15050.         <layer>background</layer>
  15051.         <id>4</id>
  15052.         <text><span class="style3">ASTS
  15053.  
  15054. It is frequently useful to declare an array of pointers to a base class, each of which is assigned a newly-allocated object of a derived class.  For example:
  15055. </span><span class="style4">
  15056.     Person  *person[10];
  15057.     person[0] = new Person;
  15058.     person[1] = new Student;
  15059.     person[2] = new Grad_Student;
  15060.                    .
  15061.                    .
  15062.  
  15063. </span><span class="style3">If virtual methods are used, then </span><span class="style4">set</span><span class="style3"> and </span><span class="style4">print</span><span class="style3"> messages can be sent to any element of the array to invoke the </span><span class="style4">set()</span><span class="style3"> and </span><span class="style4">print()</span><span class="style3"> methods belonging to the run-time class of the object.  However, if a derived class declares a new method not contained in the base class, then the compiler must be informed of the class of the object before it will accept this message.
  15064.  
  15065. </span></text>
  15066.     </content>
  15067.     <content>
  15068.         <layer>background</layer>
  15069.         <id>7</id>
  15070.         <text>131</text>
  15071.     </content>
  15072.     <name></name>
  15073.     <script></script>
  15074. </card>
  15075.  
  15076.  
  15077. card_44045.xml
  15078. <?xml version="1.0" encoding="utf-8" ?>
  15079. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15080. <card>
  15081.     <id>44045</id>
  15082.     <filler1>0</filler1>
  15083.     <cantDelete> <false /> </cantDelete>
  15084.     <showPict> <true /> </showPict>
  15085.     <dontSearch> <false /> </dontSearch>
  15086.     <owner>4755</owner>
  15087.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15088.     <content>
  15089.         <layer>background</layer>
  15090.         <id>4</id>
  15091.         <text><span class="style3">or example, suppose the </span><span class="style4">Student</span><span class="style3"> class defines a new method called </span><span class="style4">set_roommate()</span><span class="style3">.  Then a compilation error (similar to that discussed at the beginning of this section) will occur when the following line is encountered:
  15092. </span><span class="style4">
  15093.     person[1]->set_roommate();  // compilation error: "no such member"
  15094.  
  15095. </span><span class="style3">Since all elements of the array are declared at compile-time to be </span><span class="style4">Person</span><span class="style3"> pointers, a </span><span class="style7">cast</span><span class="style3">* must be used to inform the compiler of the correct type for </span><span class="style4">person[1]</span><span class="style3">:
  15096. </span><span class="style4">
  15097.     ((Student*) person[1])->set_roommate();
  15098.  
  15099. </span><span class="style3">
  15100.  
  15101.  
  15102.  
  15103.  
  15104.  
  15105.  
  15106. </span></text>
  15107.     </content>
  15108.     <content>
  15109.         <layer>background</layer>
  15110.         <id>7</id>
  15111.         <text>132</text>
  15112.     </content>
  15113.     <content>
  15114.         <layer>background</layer>
  15115.         <id>29</id>
  15116.         <text>47191</text>
  15117.     </content>
  15118.     <content>
  15119.         <layer>background</layer>
  15120.         <id>27</id>
  15121.         <text>Casts for type conversion</text>
  15122.     </content>
  15123.     <content>
  15124.         <layer>background</layer>
  15125.         <id>20</id>
  15126.         <text>Casts for type conversion - p175</text>
  15127.     </content>
  15128.     <content>
  15129.         <layer>background</layer>
  15130.         <id>17</id>
  15131.         <text>p66</text>
  15132.     </content>
  15133.     <name></name>
  15134.     <script></script>
  15135. </card>
  15136.  
  15137.  
  15138. card_43696.xml
  15139. <?xml version="1.0" encoding="utf-8" ?>
  15140. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15141. <card>
  15142.     <id>43696</id>
  15143.     <filler1>0</filler1>
  15144.     <cantDelete> <false /> </cantDelete>
  15145.     <showPict> <true /> </showPict>
  15146.     <dontSearch> <false /> </dontSearch>
  15147.     <owner>4755</owner>
  15148.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15149.     <content>
  15150.         <layer>background</layer>
  15151.         <id>4</id>
  15152.         <text><span class="style3">t is customary to initialize objects immediately after allocation, and "clean up" after them before deallocating.  TC/C++ provide a facility for "constructing" and "destroying" objects automatically upon allocation and deallocation.  Since this convenience feature was added to Think C only recently, many Think C programs instead use separate </span><span class="style4">init()</span><span class="style3"> and </span><span class="style4">dispose()</span><span class="style3"> methods to handle this.  C++ still provides greater flexibility than does Think C; therefore, this section describes only those techniques which work equally under Think C and C++.
  15153.  
  15154. A </span><span class="style7">constructor</span><span class="style3"> is a method whose name is the name of the class.  This method is invoked automatically upon allocation of an object of this class; e.g. when the </span><span class="style4">new</span><span class="style3"> operator is applied.  Its purpose is to initialize and/or allocate the instance variables of the object.  A </span><span class="style7">destructor</span><span class="style3"> is a method whose name is the name of the class, preceded by the ~ ("tilde") symbol.  Its purpose is to deallocate any instance variables which have the "free store" storage class (including those instance variables which are themselves objects).  The destructor is invoked automatically when an object is deallocated; e.g. when the </span><span class="style4">delete</span><span class="style3"> operator is applied.
  15155. </span></text>
  15156.     </content>
  15157.     <content>
  15158.         <layer>background</layer>
  15159.         <id>7</id>
  15160.         <text>133</text>
  15161.     </content>
  15162.     <content>
  15163.         <layer>background</layer>
  15164.         <id>6</id>
  15165.         <text>4.4  Constructors & Destructors</text>
  15166.     </content>
  15167.     <content>
  15168.         <layer>background</layer>
  15169.         <id>17</id>
  15170.         <text>p46</text>
  15171.     </content>
  15172.     <name></name>
  15173.     <script></script>
  15174. </card>
  15175.  
  15176.  
  15177. card_70218.xml
  15178. <?xml version="1.0" encoding="utf-8" ?>
  15179. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15180. <card>
  15181.     <id>70218</id>
  15182.     <filler1>0</filler1>
  15183.     <cantDelete> <false /> </cantDelete>
  15184.     <showPict> <true /> </showPict>
  15185.     <dontSearch> <false /> </dontSearch>
  15186.     <owner>4755</owner>
  15187.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15188.     <content>
  15189.         <layer>background</layer>
  15190.         <id>4</id>
  15191.         <text><span class="style3">onstructors and destructors may not declare any return value, and may only declare the void parameter.  (Constructors may take arguments in C++ but not in Think C.)  They are always virtual in Think C:  the run-time type of the object determines which constructor or destructor is invoked.  (Since C++ destructors may be virtual or non-virtual, you should declare Think C destructors virtual for compatibility.)
  15192.  
  15193. If a class is not a root class (that is, it has a parent class), then the constructors and destructors of </span><span class="style7">all</span><span class="style3"> its ancestors are called, in sequence, when an object of the class is allocated and deallocated.  (The sequence is root-to-class for constructors and class-to-root for destructors.)  Therefore, it is good practice to use a constructor to initialize only those instance variables which are newly declared in a given class.  The instance variables which are inherited from the parent class should be initialized in the parent class' constructor.  Likewise, the destructor should only deallocate those instance variables which were initialized by the constructor of the same class.
  15194.  
  15195. In the following example, class </span><span class="style4">A</span><span class="style3"> is a root class and class </span><span class="style4">B</span><span class="style3"> descends from </span><span class="style4">A</span><span class="style3">:
  15196. </span></text>
  15197.     </content>
  15198.     <content>
  15199.         <layer>background</layer>
  15200.         <id>17</id>
  15201.         <text>p46</text>
  15202.     </content>
  15203.     <content>
  15204.         <layer>background</layer>
  15205.         <id>7</id>
  15206.         <text>134</text>
  15207.     </content>
  15208.     <content>
  15209.         <layer>background</layer>
  15210.         <id>18</id>
  15211.         <text>p130</text>
  15212.     </content>
  15213.     <name></name>
  15214.     <script></script>
  15215. </card>
  15216.  
  15217.  
  15218. card_70687.xml
  15219. <?xml version="1.0" encoding="utf-8" ?>
  15220. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15221. <card>
  15222.     <id>70687</id>
  15223.     <filler1>0</filler1>
  15224.     <cantDelete> <false /> </cantDelete>
  15225.     <showPict> <true /> </showPict>
  15226.     <dontSearch> <false /> </dontSearch>
  15227.     <owner>4755</owner>
  15228.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15229.     <content>
  15230.         <layer>background</layer>
  15231.         <id>4</id>
  15232.         <text><span class="style4">   struct A:indirect    // omit ":indirect" for C++
  15233.     {   C   *c1;      
  15234.         A(void);         // constructor for A
  15235.         ~A(void);        // destructor for A
  15236.     };
  15237.     A::A(void)
  15238.     {   c1 = new C;
  15239.     }
  15240.     A::~A(void)
  15241.     {   delete c1;
  15242.     }
  15243.     struct B:A
  15244.     {   C   *c2;
  15245.         B(void);
  15246.         ~B(void);
  15247.     };
  15248.     B::B(void)
  15249.     {   c2 = new C;
  15250.     }
  15251.     B::~B(void)
  15252.     {   delete c2;
  15253.     }</span></text>
  15254.     </content>
  15255.     <content>
  15256.         <layer>background</layer>
  15257.         <id>17</id>
  15258.         <text>p202</text>
  15259.     </content>
  15260.     <content>
  15261.         <layer>background</layer>
  15262.         <id>7</id>
  15263.         <text>135</text>
  15264.     </content>
  15265.     <name></name>
  15266.     <script></script>
  15267. </card>
  15268.  
  15269.  
  15270. card_71054.xml
  15271. <?xml version="1.0" encoding="utf-8" ?>
  15272. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15273. <card>
  15274.     <id>71054</id>
  15275.     <filler1>0</filler1>
  15276.     <cantDelete> <false /> </cantDelete>
  15277.     <showPict> <true /> </showPict>
  15278.     <dontSearch> <false /> </dontSearch>
  15279.     <owner>4755</owner>
  15280.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15281.     <content>
  15282.         <layer>background</layer>
  15283.         <id>4</id>
  15284.         <text><span class="style3">he instance variable </span><span class="style4">c1</span><span class="style3"> is an object reference to an object of class </span><span class="style4">C</span><span class="style3"> (which should be defined elsewhere).  </span><span class="style4">c1</span><span class="style3"> is inherited by objects of class </span><span class="style4">B</span><span class="style3">.  However, </span><span class="style4">c1</span><span class="style3"> is not initialized in the constructor for class </span><span class="style4">B</span><span class="style3">.  Instead, it is initialized in the constructor for class </span><span class="style4">A</span><span class="style3"> where it was first declared.
  15285. </span><span class="style4">
  15286.     B    *b;
  15287.     b = new B;      // allocate b and invoke constructors
  15288.         ...
  15289.     delete b;       // deallocate b and invoke destructors
  15290.  
  15291. </span><span class="style3">When an object </span><span class="style4">b</span><span class="style3"> class </span><span class="style4">B</span><span class="style3"> is allocated, the constructor for class </span><span class="style4">A</span><span class="style3"> is automatically invoked (allocating </span><span class="style4">c1</span><span class="style3">), followed by the constructor for class </span><span class="style4">B</span><span class="style3"> (allocating </span><span class="style4">c2</span><span class="style3">).  Thus, all instance variables ‚Äî inherited or otherwise ‚Äî of </span><span class="style4">b</span><span class="style3"> are initialized once and only once.
  15292.  
  15293. Likewise, when </span><span class="style4">b</span><span class="style3"> is deallocated, the destructor for class </span><span class="style4">B</span><span class="style3"> is automatically invoked (deallocating </span><span class="style4">c2</span><span class="style3">) followed by the destructor for class </span><span class="style4">A</span><span class="style3"> (deallocating </span><span class="style4">c1</span><span class="style3">).</span></text>
  15294.     </content>
  15295.     <content>
  15296.         <layer>background</layer>
  15297.         <id>7</id>
  15298.         <text>136</text>
  15299.     </content>
  15300.     <content>
  15301.         <layer>background</layer>
  15302.         <id>17</id>
  15303.         <text>p153</text>
  15304.     </content>
  15305.     <name></name>
  15306.     <script></script>
  15307. </card>
  15308.  
  15309.  
  15310. card_71809.xml
  15311. <?xml version="1.0" encoding="utf-8" ?>
  15312. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15313. <card>
  15314.     <id>71809</id>
  15315.     <filler1>0</filler1>
  15316.     <cantDelete> <false /> </cantDelete>
  15317.     <showPict> <true /> </showPict>
  15318.     <dontSearch> <false /> </dontSearch>
  15319.     <owner>4755</owner>
  15320.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15321.     <content>
  15322.         <layer>background</layer>
  15323.         <id>17</id>
  15324.         <text>p215</text>
  15325.     </content>
  15326.     <content>
  15327.         <layer>background</layer>
  15328.         <id>4</id>
  15329.         <text><span class="style3">UCCESSFUL CONSTRUCTION
  15330.  
  15331. The </span><span class="style4">new</span><span class="style3"> operator usually returns a pointer to a newly-created object.  However, if there is insufficient memory available to allocate this object, then the </span><span class="style4">NULL</span><span class="style3"> pointer* is returned instead.  It is good practice to check whether this has occurred, especially when allocating large objects, since sending messages to </span><span class="style4">NULL</span><span class="style3"> can cause your program to crash.
  15332.  
  15333. It is also desirable to check whether your object failed to initialized successfully ‚Äî for example when there is insufficient memory to allocate one of the instance variables.
  15334.  
  15335. One solution is to use a root class containing an "</span><span class="style4">initialized</span><span class="style3">" instance variable whose status indicates whether initialization was successful.  Since the constructors of </span><span class="style7">all</span><span class="style3"> ancestors of a non-root class are called in sequence, they may each check the status of this instance variable to see whether the constructor of the parent class succeeded.  The example later in this chapter illustrates this technique.</span></text>
  15336.     </content>
  15337.     <content>
  15338.         <layer>background</layer>
  15339.         <id>29</id>
  15340.         <text>69591</text>
  15341.     </content>
  15342.     <content>
  15343.         <layer>background</layer>
  15344.         <id>27</id>
  15345.         <text>The NULL pointer</text>
  15346.     </content>
  15347.     <content>
  15348.         <layer>background</layer>
  15349.         <id>20</id>
  15350.         <text>The NULL pointer - p67</text>
  15351.     </content>
  15352.     <content>
  15353.         <layer>background</layer>
  15354.         <id>7</id>
  15355.         <text>137</text>
  15356.     </content>
  15357.     <name></name>
  15358.     <script></script>
  15359. </card>
  15360.  
  15361.  
  15362. card_68970.xml
  15363. <?xml version="1.0" encoding="utf-8" ?>
  15364. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15365. <card>
  15366.     <id>68970</id>
  15367.     <filler1>0</filler1>
  15368.     <cantDelete> <false /> </cantDelete>
  15369.     <showPict> <true /> </showPict>
  15370.     <dontSearch> <false /> </dontSearch>
  15371.     <owner>4755</owner>
  15372.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15373.     <content>
  15374.         <layer>background</layer>
  15375.         <id>4</id>
  15376.         <text><span class="style3"> further OOP convenience (some say necessity) </span><span class="style3">provided by TC/C++ is the use of the </span><span class="style4">private</span><span class="style3">, </span><span class="style4">protected</span><span class="style3">, and </span><span class="style4">public</span><span class="style3"> </span><span class="style7">access specifiers</span><span class="style3">.  The </span><span class="style4">public</span><span class="style3"> specifier is default for classes declared with </span><span class="style4">struct</span><span class="style3">.  The </span><span class="style4">protected</span><span class="style3"> specifier restricts the scope of the instance variables and methods following it so they are accessible only within methods of the class or of derived classes.  The </span><span class="style4">private</span><span class="style3"> specifier allows access to class members only within methods of the same class.
  15377. </span><span class="style4">
  15378.     struct   Rolls:Automobile
  15379.     {
  15380.     private:
  15381.         char            *favorite_wine[100];
  15382.         int             lookup_wine_list(char*);
  15383.  
  15384.     public:
  15385.         virtual void    restock_wines(int);
  15386.     };
  15387.  
  15388. </span><span class="style3">In this example, it is possible to access the </span><span class="style4">favorite_wine</span><span class="style3"> instance variable from within the body of the </span><span class="style4">restock_wines()</span><span class="style3"> method.  However, the compiler will </span></text>
  15389.     </content>
  15390.     <content>
  15391.         <layer>background</layer>
  15392.         <id>6</id>
  15393.         <text>4.5  Access Specifiers</text>
  15394.     </content>
  15395.     <content>
  15396.         <layer>background</layer>
  15397.         <id>7</id>
  15398.         <text>138</text>
  15399.     </content>
  15400.     <content>
  15401.         <layer>background</layer>
  15402.         <id>17</id>
  15403.         <text>p202</text>
  15404.     </content>
  15405.     <name></name>
  15406.     <script></script>
  15407. </card>
  15408.  
  15409.  
  15410. card_68540.xml
  15411. <?xml version="1.0" encoding="utf-8" ?>
  15412. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15413. <card>
  15414.     <id>68540</id>
  15415.     <filler1>0</filler1>
  15416.     <cantDelete> <false /> </cantDelete>
  15417.     <showPict> <true /> </showPict>
  15418.     <dontSearch> <false /> </dontSearch>
  15419.     <owner>4755</owner>
  15420.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15421.     <content>
  15422.         <layer>background</layer>
  15423.         <id>4</id>
  15424.         <text><span class="style3">isallow access to </span><span class="style4">favorite_wine</span><span class="style3"> from other functions or methods.  Likewise, you can only send </span><span class="style4">lookup_wine_list</span><span class="style3"> messages from within the body of the </span><span class="style4">restock_wines()</span><span class="style3"> method.  Since</span><span class="style4"> restock_wines()</span><span class="style3"> is a public method, you can send </span><span class="style4">restock_wines</span><span class="style3"> messages from any methods or functions which have a </span><span class="style4">Rolls</span><span class="style3"> object in scope.
  15425.  
  15426. The constructors and destructors (previous section) of a class are usually declared public.  Otherwise the compiler disallows allocating or deallocating objects of this class.
  15427.  
  15428. The purpose of access specifiers is to improve modularity in the class hierarchy.  Typically all instance variables are made private to guard against direct access from outside the class.  A few public methods remain to provide a well-defined interface to the class.  This allows the programmer to change the implementations of the instance variables ‚Äî and the methods which use them ‚Äî without changing classes which derive from this class or which make use of objects of this class.  C++ (but not Think C) also provides the ability to declare some classes as </span><span class="style4">friends</span><span class="style3"> with members of another class, to circumvent the usual privacy.
  15429.  
  15430. </span></text>
  15431.     </content>
  15432.     <content>
  15433.         <layer>background</layer>
  15434.         <id>7</id>
  15435.         <text>139</text>
  15436.     </content>
  15437.     <content>
  15438.         <layer>background</layer>
  15439.         <id>17</id>
  15440.         <text>p153</text>
  15441.     </content>
  15442.     <name></name>
  15443.     <script></script>
  15444. </card>
  15445.  
  15446.  
  15447. card_68283.xml
  15448. <?xml version="1.0" encoding="utf-8" ?>
  15449. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15450. <card>
  15451.     <id>68283</id>
  15452.     <filler1>0</filler1>
  15453.     <cantDelete> <false /> </cantDelete>
  15454.     <showPict> <true /> </showPict>
  15455.     <dontSearch> <false /> </dontSearch>
  15456.     <owner>4755</owner>
  15457.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15458.     <content>
  15459.         <layer>background</layer>
  15460.         <id>4</id>
  15461.         <text>A limitation of TC/C++ access specifiers is that objects of a given class can always access private parts of other objects of the same class.  Bjarne Stroustrup says, "The unit of protection in C++ is a class, not an individual object of a class", p. 138 of his seminal book.*</text>
  15462.     </content>
  15463.     <content>
  15464.         <layer>background</layer>
  15465.         <id>29</id>
  15466.         <text>2231</text>
  15467.     </content>
  15468.     <content>
  15469.         <layer>background</layer>
  15470.         <id>27</id>
  15471.         <text>Bibliography</text>
  15472.     </content>
  15473.     <content>
  15474.         <layer>background</layer>
  15475.         <id>20</id>
  15476.         <text>Bibliography - p259</text>
  15477.     </content>
  15478.     <content>
  15479.         <layer>background</layer>
  15480.         <id>7</id>
  15481.         <text>140</text>
  15482.     </content>
  15483.     <content>
  15484.         <layer>background</layer>
  15485.         <id>17</id>
  15486.         <text>p153</text>
  15487.     </content>
  15488.     <name></name>
  15489.     <script></script>
  15490. </card>
  15491.  
  15492.  
  15493. card_40401.xml
  15494. <?xml version="1.0" encoding="utf-8" ?>
  15495. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15496. <card>
  15497.     <id>40401</id>
  15498.     <filler1>0</filler1>
  15499.     <cantDelete> <false /> </cantDelete>
  15500.     <showPict> <true /> </showPict>
  15501.     <dontSearch> <false /> </dontSearch>
  15502.     <owner>4755</owner>
  15503.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15504.     <content>
  15505.         <layer>background</layer>
  15506.         <id>7</id>
  15507.         <text>141</text>
  15508.     </content>
  15509.     <content>
  15510.         <layer>background</layer>
  15511.         <id>4</id>
  15512.         <text><span class="style3">UPERCLASS ACCESS
  15513.  
  15514. By default, the public and protected members of a class declared with </span><span class="style4">struct</span><span class="style3"> remain public and protected in derived classes.  However, you can preface the superclass name with </span><span class="style4">public</span><span class="style3"> or </span><span class="style4">private</span><span class="style3"> when declaring a new class, to change this inheritance property.  In the example below, the public and protected members of class </span><span class="style4">A</span><span class="style3"> remain public and protected members of class </span><span class="style4">B</span><span class="style3">, but all members of class </span><span class="style4">A</span><span class="style3"> are private members of class </span><span class="style4">C</span><span class="style3">.
  15515. </span><span class="style4">
  15516.     struct B:public A
  15517.     {   ...
  15518.     }
  15519.  
  15520.     struct C:private A
  15521.     {   ...
  15522.     }
  15523.  
  15524. </span></text>
  15525.     </content>
  15526.     <content>
  15527.         <layer>background</layer>
  15528.         <id>17</id>
  15529.         <text>p202</text>
  15530.     </content>
  15531.     <name></name>
  15532.     <script></script>
  15533. </card>
  15534.  
  15535.  
  15536. card_43452.xml
  15537. <?xml version="1.0" encoding="utf-8" ?>
  15538. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15539. <card>
  15540.     <id>43452</id>
  15541.     <filler1>0</filler1>
  15542.     <cantDelete> <false /> </cantDelete>
  15543.     <showPict> <true /> </showPict>
  15544.     <dontSearch> <false /> </dontSearch>
  15545.     <owner>4755</owner>
  15546.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15547.     <content>
  15548.         <layer>background</layer>
  15549.         <id>4</id>
  15550.         <text><span class="style3">LASS DECLARATION
  15551.  
  15552. In addition to the extensions of the C </span><span class="style4">struct</span><span class="style3"> type, TC/C++ allows user-defined types to be declared using the </span><span class="style4">class</span><span class="style3"> keyword.  Classes are defined with </span><span class="style4">class</span><span class="style3"> using the same syntax as classes defined with </span><span class="style4">struct</span><span class="style3">, except that the default access specifier is </span><span class="style4">private</span><span class="style3"> instead of </span><span class="style4">public</span><span class="style3">.  Also, when a class is declared with </span><span class="style4">class</span><span class="style3"> and the superclass access is not specified, the default is </span><span class="style4">private</span><span class="style3"> instead of </span><span class="style4">public</span><span class="style3">.  In this example, all inherited members of class </span><span class="style4">Person</span><span class="style3"> are private members of </span><span class="style4">Student</span><span class="style3">:
  15553. </span><span class="style4">
  15554.     class Student:Person
  15555.     {
  15556.         ...
  15557.     };
  15558.  
  15559. </span><span class="style3">The (Think C only) "</span><span class="style4">:direct</span><span class="style3">" or "</span><span class="style4">:indirect</span><span class="style3">" specifiers* may be omitted from the declaration of a root class which is declared using the </span><span class="style4">class</span><span class="style3"> keyword.  A compiler option allows selection between these specifiers.  This simplifies porting code to C++ compilers.
  15560. </span><span class="style4">
  15561. </span><span class="style3">
  15562. </span></text>
  15563.     </content>
  15564.     <content>
  15565.         <layer>background</layer>
  15566.         <id>7</id>
  15567.         <text>142</text>
  15568.     </content>
  15569.     <content>
  15570.         <layer>background</layer>
  15571.         <id>27</id>
  15572.         <text>Macintosh memory management
  15573. </text>
  15574.     </content>
  15575.     <content>
  15576.         <layer>background</layer>
  15577.         <id>29</id>
  15578.         <text>38494</text>
  15579.     </content>
  15580.     <content>
  15581.         <layer>background</layer>
  15582.         <id>20</id>
  15583.         <text>Macintosh memory management - p158</text>
  15584.     </content>
  15585.     <content>
  15586.         <layer>background</layer>
  15587.         <id>18</id>
  15588.         <text>p251</text>
  15589.     </content>
  15590.     <name></name>
  15591.     <script></script>
  15592. </card>
  15593.  
  15594.  
  15595. card_42427.xml
  15596. <?xml version="1.0" encoding="utf-8" ?>
  15597. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15598. <card>
  15599.     <id>42427</id>
  15600.     <filler1>0</filler1>
  15601.     <cantDelete> <false /> </cantDelete>
  15602.     <showPict> <true /> </showPict>
  15603.     <dontSearch> <false /> </dontSearch>
  15604.     <owner>4755</owner>
  15605.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15606.     <content>
  15607.         <layer>background</layer>
  15608.         <id>6</id>
  15609.         <text>4.6  Example & Documentation</text>
  15610.     </content>
  15611.     <content>
  15612.         <layer>background</layer>
  15613.         <id>4</id>
  15614.         <text><span class="style3">he following pages contain source code for a complete example demonstrating the use of TC/C++ object-oriented programming techniques.  Each page contains a scrol- ling text field whose contents may be pasted into an individual file for compilation.
  15615.  
  15616. As mentioned earlier, it is traditional to place the declaration for each class in a separate header file (indicated by the extension "</span><span class="style18">.h</span><span class="style3">" in the file name).  The method definitions for each class are usually contained in a source file (indicated by the "</span><span class="style18">.c</span><span class="style3">" extension).  The declarations in the headers may be accessed from the appropriate source files using the </span><span class="style4">#include</span><span class="style3"> preprocessor directive.*  (Chapter 7 also discusses the </span><span class="style4">#define</span><span class="style3"> and </span><span class="style4">#ifndef</span><span class="style3"> directives used to prevent multiple references to the same header file, as well as an alternative approach available in Think C only.)  Finally, the </span><span class="style18">main.c</span><span class="style3"> source file contains the </span><span class="style4">main()</span><span class="style3"> function where execution of the program begins.
  15617.  
  15618. The example is based on the "Person/Student" example described earlier, but makes use of access specifiers and constructors/destructors.  A "class hierarchy" showing how each class is derived is illustrated below.  This diagram is similar to that</span></text>
  15619.     </content>
  15620.     <content>
  15621.         <layer>background</layer>
  15622.         <id>7</id>
  15623.         <text>143</text>
  15624.     </content>
  15625.     <content>
  15626.         <layer>background</layer>
  15627.         <id>29</id>
  15628.         <text>52189</text>
  15629.     </content>
  15630.     <content>
  15631.         <layer>background</layer>
  15632.         <id>27</id>
  15633.         <text>File inclusion</text>
  15634.     </content>
  15635.     <content>
  15636.         <layer>background</layer>
  15637.         <id>20</id>
  15638.         <text>File inclusion - p199</text>
  15639.     </content>
  15640.     <name></name>
  15641.     <script></script>
  15642. </card>
  15643.  
  15644.  
  15645. card_72172.xml
  15646. <?xml version="1.0" encoding="utf-8" ?>
  15647. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15648. <card>
  15649.     <id>72172</id>
  15650.     <filler1>0</filler1>
  15651.     <bitmap>BMAP_72219.pbm</bitmap>
  15652.     <cantDelete> <false /> </cantDelete>
  15653.     <showPict> <true /> </showPict>
  15654.     <dontSearch> <false /> </dontSearch>
  15655.     <owner>4755</owner>
  15656.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15657.     <part>
  15658.         <id>1</id>
  15659.         <type>field</type>
  15660.         <visible> <true /> </visible>
  15661.         <dontWrap> <false /> </dontWrap>
  15662.         <dontSearch> <false /> </dontSearch>
  15663.         <sharedText> <false /> </sharedText>
  15664.         <fixedLineHeight> <false /> </fixedLineHeight>
  15665.         <autoTab> <false /> </autoTab>
  15666.         <lockText> <false /> </lockText>
  15667.         <rect>
  15668.             <left>179</left>
  15669.             <top>148</top>
  15670.             <right>308</right>
  15671.             <bottom>171</bottom>
  15672.         </rect>
  15673.         <style>shadow</style>
  15674.         <autoSelect> <false /> </autoSelect>
  15675.         <showLines> <false /> </showLines>
  15676.         <wideMargins> <true /> </wideMargins>
  15677.         <multipleLines> <false /> </multipleLines>
  15678.         <reservedFamily> 0 </reservedFamily>
  15679.         <titleWidth>0</titleWidth>
  15680.         <icon>0</icon>
  15681.         <textAlign>center</textAlign>
  15682.         <font>Monaco</font>
  15683.         <textSize>9</textSize>
  15684.         <textStyle>plain</textStyle>
  15685.         <textHeight>12</textHeight>
  15686.         <name></name>
  15687.         <script></script>
  15688.     </part>
  15689.     <part>
  15690.         <id>2</id>
  15691.         <type>field</type>
  15692.         <visible> <true /> </visible>
  15693.         <dontWrap> <false /> </dontWrap>
  15694.         <dontSearch> <false /> </dontSearch>
  15695.         <sharedText> <false /> </sharedText>
  15696.         <fixedLineHeight> <false /> </fixedLineHeight>
  15697.         <autoTab> <false /> </autoTab>
  15698.         <lockText> <false /> </lockText>
  15699.         <rect>
  15700.             <left>69</left>
  15701.             <top>200</top>
  15702.             <right>198</right>
  15703.             <bottom>235</bottom>
  15704.         </rect>
  15705.         <style>shadow</style>
  15706.         <autoSelect> <false /> </autoSelect>
  15707.         <showLines> <false /> </showLines>
  15708.         <wideMargins> <true /> </wideMargins>
  15709.         <multipleLines> <false /> </multipleLines>
  15710.         <reservedFamily> 0 </reservedFamily>
  15711.         <titleWidth>0</titleWidth>
  15712.         <icon>0</icon>
  15713.         <textAlign>center</textAlign>
  15714.         <font>Monaco</font>
  15715.         <textSize>9</textSize>
  15716.         <textStyle>plain</textStyle>
  15717.         <textHeight>12</textHeight>
  15718.         <name></name>
  15719.         <script></script>
  15720.     </part>
  15721.     <part>
  15722.         <id>3</id>
  15723.         <type>field</type>
  15724.         <visible> <true /> </visible>
  15725.         <dontWrap> <false /> </dontWrap>
  15726.         <dontSearch> <false /> </dontSearch>
  15727.         <sharedText> <false /> </sharedText>
  15728.         <fixedLineHeight> <false /> </fixedLineHeight>
  15729.         <autoTab> <false /> </autoTab>
  15730.         <lockText> <false /> </lockText>
  15731.         <rect>
  15732.             <left>69</left>
  15733.             <top>260</top>
  15734.             <right>198</right>
  15735.             <bottom>283</bottom>
  15736.         </rect>
  15737.         <style>shadow</style>
  15738.         <autoSelect> <false /> </autoSelect>
  15739.         <showLines> <false /> </showLines>
  15740.         <wideMargins> <true /> </wideMargins>
  15741.         <multipleLines> <false /> </multipleLines>
  15742.         <reservedFamily> 0 </reservedFamily>
  15743.         <titleWidth>0</titleWidth>
  15744.         <icon>0</icon>
  15745.         <textAlign>center</textAlign>
  15746.         <font>Monaco</font>
  15747.         <textSize>9</textSize>
  15748.         <textStyle>plain</textStyle>
  15749.         <textHeight>12</textHeight>
  15750.         <name></name>
  15751.         <script></script>
  15752.     </part>
  15753.     <part>
  15754.         <id>5</id>
  15755.         <type>field</type>
  15756.         <visible> <true /> </visible>
  15757.         <dontWrap> <false /> </dontWrap>
  15758.         <dontSearch> <false /> </dontSearch>
  15759.         <sharedText> <false /> </sharedText>
  15760.         <fixedLineHeight> <false /> </fixedLineHeight>
  15761.         <autoTab> <false /> </autoTab>
  15762.         <lockText> <false /> </lockText>
  15763.         <rect>
  15764.             <left>288</left>
  15765.             <top>200</top>
  15766.             <right>417</right>
  15767.             <bottom>223</bottom>
  15768.         </rect>
  15769.         <style>shadow</style>
  15770.         <autoSelect> <false /> </autoSelect>
  15771.         <showLines> <false /> </showLines>
  15772.         <wideMargins> <true /> </wideMargins>
  15773.         <multipleLines> <false /> </multipleLines>
  15774.         <reservedFamily> 0 </reservedFamily>
  15775.         <titleWidth>0</titleWidth>
  15776.         <icon>0</icon>
  15777.         <textAlign>center</textAlign>
  15778.         <font>Monaco</font>
  15779.         <textSize>9</textSize>
  15780.         <textStyle>plain</textStyle>
  15781.         <textHeight>12</textHeight>
  15782.         <name></name>
  15783.         <script></script>
  15784.     </part>
  15785.     <content>
  15786.         <layer>background</layer>
  15787.         <id>4</id>
  15788.         <text><span class="style3">resented by Think C's "Browser" feature, and is a useful documentation tool.  In this sort of diagram it is important to note that the main relationship presented is that of inheritance, not containment.  For example, although the </span><span class="style4">Checkbook</span><span class="style3"> class is not </span><span class="style7">derived</span><span class="style3"> from the </span><span class="style4">Person</span><span class="style3"> class (a </span><span class="style4">Checkbook</span><span class="style3"> is not a "kind of" </span><span class="style4">Person</span><span class="style3">), the </span><span class="style4">Person</span><span class="style3"> class may </span><span class="style7">contain</span><span class="style3"> an instance variable of class </span><span class="style4">Checkbook</span><span class="style3">.
  15789.  
  15790.  
  15791.  
  15792.  
  15793.  
  15794.  
  15795.  
  15796.  
  15797.  
  15798.  
  15799.  
  15800.  
  15801.  
  15802. </span></text>
  15803.     </content>
  15804.     <content>
  15805.         <layer>card</layer>
  15806.         <id>1</id>
  15807.         <text>Generic_Class</text>
  15808.     </content>
  15809.     <content>
  15810.         <layer>card</layer>
  15811.         <id>2</id>
  15812.         <text><span class="style3">erson
  15813. </span><span class="style11">(contains: </span><span class="style3">Checkbook</span><span class="style11">)</span></text>
  15814.     </content>
  15815.     <content>
  15816.         <layer>card</layer>
  15817.         <id>3</id>
  15818.         <text>Student</text>
  15819.     </content>
  15820.     <content>
  15821.         <layer>card</layer>
  15822.         <id>5</id>
  15823.         <text>Checkbook</text>
  15824.     </content>
  15825.     <content>
  15826.         <layer>background</layer>
  15827.         <id>7</id>
  15828.         <text>144</text>
  15829.     </content>
  15830.     <name></name>
  15831.     <script></script>
  15832. </card>
  15833.  
  15834.  
  15835. card_40835.xml
  15836. <?xml version="1.0" encoding="utf-8" ?>
  15837. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  15838. <card>
  15839.     <id>40835</id>
  15840.     <filler1>0</filler1>
  15841.     <cantDelete> <false /> </cantDelete>
  15842.     <showPict> <true /> </showPict>
  15843.     <dontSearch> <false /> </dontSearch>
  15844.     <owner>4755</owner>
  15845.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  15846.     <part>
  15847.         <id>1</id>
  15848.         <type>field</type>
  15849.         <visible> <true /> </visible>
  15850.         <dontWrap> <false /> </dontWrap>
  15851.         <dontSearch> <false /> </dontSearch>
  15852.         <sharedText> <false /> </sharedText>
  15853.         <fixedLineHeight> <true /> </fixedLineHeight>
  15854.         <autoTab> <false /> </autoTab>
  15855.         <lockText> <false /> </lockText>
  15856.         <rect>
  15857.             <left>30</left>
  15858.             <top>78</top>
  15859.             <right>478</right>
  15860.             <bottom>296</bottom>
  15861.         </rect>
  15862.         <style>scrolling</style>
  15863.         <autoSelect> <false /> </autoSelect>
  15864.         <showLines> <false /> </showLines>
  15865.         <wideMargins> <false /> </wideMargins>
  15866.         <multipleLines> <false /> </multipleLines>
  15867.         <reservedFamily> 0 </reservedFamily>
  15868.         <titleWidth>0</titleWidth>
  15869.         <icon>0</icon>
  15870.         <textAlign>left</textAlign>
  15871.         <font>Monaco</font>
  15872.         <textSize>9</textSize>
  15873.         <textStyle>plain</textStyle>
  15874.         <textHeight>12</textHeight>
  15875.         <name>code</name>
  15876.         <script></script>
  15877.     </part>
  15878.     <part>
  15879.         <id>2</id>
  15880.         <type>button</type>
  15881.         <visible> <true /> </visible>
  15882.         <reserved5> 0 </reserved5>
  15883.         <reserved4> 0 </reserved4>
  15884.         <reserved3> 0 </reserved3>
  15885.         <reserved2> 0 </reserved2>
  15886.         <reserved1> 0 </reserved1>
  15887.         <enabled> <true /> </enabled>
  15888.         <rect>
  15889.             <left>13</left>
  15890.             <top>29</top>
  15891.             <right>351</right>
  15892.             <bottom>57</bottom>
  15893.         </rect>
  15894.         <style>opaque</style>
  15895.         <showName> <false /> </showName>
  15896.         <highlight> <false /> </highlight>
  15897.         <autoHighlight> <false /> </autoHighlight>
  15898.         <sharedHighlight> <true /> </sharedHighlight>
  15899.         <family>0</family>
  15900.         <titleWidth>0</titleWidth>
  15901.         <icon>0</icon>
  15902.         <textAlign>center</textAlign>
  15903.         <font>Chicago</font>
  15904.         <textSize>12</textSize>
  15905.         <textStyle>plain</textStyle>
  15906.         <name>New Button</name>
  15907.         <script></script>
  15908.     </part>
  15909.     <part>
  15910.         <id>3</id>
  15911.         <type>button</type>
  15912.         <visible> <true /> </visible>
  15913.         <reserved5> 0 </reserved5>
  15914.         <reserved4> 0 </reserved4>
  15915.         <reserved3> 0 </reserved3>
  15916.         <reserved2> 0 </reserved2>
  15917.         <reserved1> 0 </reserved1>
  15918.         <enabled> <true /> </enabled>
  15919.         <rect>
  15920.             <left>169</left>
  15921.             <top>32</top>
  15922.             <right>305</right>
  15923.             <bottom>54</bottom>
  15924.         </rect>
  15925.         <style>roundrect</style>
  15926.         <showName> <true /> </showName>
  15927.         <highlight> <false /> </highlight>
  15928.         <autoHighlight> <true /> </autoHighlight>
  15929.         <sharedHighlight> <true /> </sharedHighlight>
  15930.         <family>0</family>
  15931.         <titleWidth>0</titleWidth>
  15932.         <icon>0</icon>
  15933.         <textAlign>center</textAlign>
  15934.         <font>Chicago</font>
  15935.         <textSize>12</textSize>
  15936.         <textStyle>plain</textStyle>
  15937.         <name>Copy to Clipboard</name>
  15938.         <script>on mouseUp
  15939. set lockscreen to true
  15940. select text of card field "code"
  15941. domenu "Copy Text"
  15942. select empty
  15943. set lockscreen to false
  15944. end mouseUp</script>
  15945.     </part>
  15946.     <content>
  15947.         <layer>card</layer>
  15948.         <id>1</id>
  15949.         <text>/*
  15950. *   FILE:    class.h
  15951. *   AUTHOR:  R.G.
  15952. *   CREATED: Jan 20, 1992
  15953. *   
  15954. *   Header file defines Generic_Class
  15955. */
  15956.  
  15957. # ifndef class_h       // prevents header "re-inclusion"
  15958. # define class_h
  15959.  
  15960. typedef  int   boolean;  // simulate boolean data type
  15961. # define TRUE  1
  15962. # define FALSE 0
  15963.  
  15964. /******************************************************************
  15965. *   Root class for all classes.  In Think C assume the "classes are
  15966. *   indirect by default" compiler option is on.
  15967. ******************************************************************/
  15968. class  Generic_Class
  15969. {
  15970. protected:
  15971.     boolean         initialized;
  15972.  
  15973. public:
  15974.     Generic_Class(void);
  15975.     boolean is_initialized(void);
  15976. };
  15977.  
  15978. # endif
  15979. </text>
  15980.     </content>
  15981.     <content>
  15982.         <layer>background</layer>
  15983.         <id>7</id>
  15984.         <text>145</text>
  15985.     </content>
  15986.     <content>
  15987.         <layer>background</layer>
  15988.         <id>6</id>
  15989.         <text>Object-oriented program using multiple source and header files</text>
  15990.     </content>
  15991.     <content>
  15992.         <layer>background</layer>
  15993.         <id>4</id>
  15994.         <text>File 1 of 9 demonstrating TC/C++ object-oriented programming:</text>
  15995.     </content>
  15996.     <name></name>
  15997.     <script></script>
  15998. </card>
  15999.  
  16000.  
  16001. card_42237.xml
  16002. <?xml version="1.0" encoding="utf-8" ?>
  16003. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  16004. <card>
  16005.     <id>42237</id>
  16006.     <filler1>0</filler1>
  16007.     <cantDelete> <false /> </cantDelete>
  16008.     <showPict> <true /> </showPict>
  16009.     <dontSearch> <false /> </dontSearch>
  16010.     <owner>4755</owner>
  16011.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  16012.     <part>
  16013.         <id>1</id>
  16014.         <type>field</type>
  16015.         <visible> <true /> </visible>
  16016.         <dontWrap> <false /> </dontWrap>
  16017.         <dontSearch> <false /> </dontSearch>
  16018.         <sharedText> <false /> </sharedText>
  16019.         <fixedLineHeight> <true /> </fixedLineHeight>
  16020.         <autoTab> <false /> </autoTab>
  16021.         <lockText> <false /> </lockText>
  16022.         <rect>
  16023.             <left>30</left>
  16024.             <top>78</top>
  16025.             <right>478</right>
  16026.             <bottom>296</bottom>
  16027.         </rect>
  16028.         <style>scrolling</style>
  16029.         <autoSelect> <false /> </autoSelect>
  16030.         <showLines> <false /> </showLines>
  16031.         <wideMargins> <false /> </wideMargins>
  16032.         <multipleLines> <false /> </multipleLines>
  16033.         <reservedFamily> 0 </reservedFamily>
  16034.         <titleWidth>0</titleWidth>
  16035.         <icon>0</icon>
  16036.         <textAlign>left</textAlign>
  16037.         <font>Monaco</font>
  16038.         <textSize>9</textSize>
  16039.         <textStyle>plain</textStyle>
  16040.         <textHeight>12</textHeight>
  16041.         <name>code</name>
  16042.         <script></script>
  16043.     </part>
  16044.     <part>
  16045.         <id>2</id>
  16046.         <type>button</type>
  16047.         <visible> <true /> </visible>
  16048.         <reserved5> 0 </reserved5>
  16049.         <reserved4> 0 </reserved4>
  16050.         <reserved3> 0 </reserved3>
  16051.         <reserved2> 0 </reserved2>
  16052.         <reserved1> 0 </reserved1>
  16053.         <enabled> <true /> </enabled>
  16054.         <rect>
  16055.             <left>169</left>
  16056.             <top>32</top>
  16057.             <right>305</right>
  16058.             <bottom>54</bottom>
  16059.         </rect>
  16060.         <style>roundrect</style>
  16061.         <showName> <true /> </showName>
  16062.         <highlight> <false /> </highlight>
  16063.         <autoHighlight> <true /> </autoHighlight>
  16064.         <sharedHighlight> <true /> </sharedHighlight>
  16065.         <family>0</family>
  16066.         <titleWidth>0</titleWidth>
  16067.         <icon>0</icon>
  16068.         <textAlign>center</textAlign>
  16069.         <font>Chicago</font>
  16070.         <textSize>12</textSize>
  16071.         <textStyle>plain</textStyle>
  16072.         <name>Copy to Clipboard</name>
  16073.         <script>on mouseUp
  16074. set lockscreen to true
  16075. select text of card field "code"
  16076. domenu "Copy Text"
  16077. select empty
  16078. set lockscreen to false
  16079. end mouseUp</script>
  16080.     </part>
  16081.     <content>
  16082.         <layer>card</layer>
  16083.         <id>1</id>
  16084.         <text>/*
  16085. *   FILE:    class.c
  16086. *   AUTHOR:  R.G.
  16087. *   CREATED: January 20, 1992
  16088. *   
  16089. *   Define methods for Generic_Class
  16090. */
  16091.  
  16092. # include "class.h"
  16093.  
  16094. /******************************************************************
  16095. *   Generic constructor.  The constructor of each derived class
  16096. *   should first check whether the parent class' constructor
  16097. *   succeeded (using is_initialized()).  If so, then the constructor
  16098. *   may attempt to allocate instance variables, setting "initalized"
  16099. *   to FALSE if unable to do so.
  16100. ******************************************************************/
  16101. Generic_Class::Generic_Class(void)
  16102. {
  16103.     initialized = TRUE;
  16104. }
  16105.  
  16106. /******************************************************************
  16107. *   is_initialized() method returns value of "initialized" instance
  16108. *   variable.  The instance variable should be set in a class'
  16109. *   constructor.  No need to override.
  16110. ******************************************************************/
  16111. boolean Generic_Class::is_initialized(void)
  16112. {
  16113.     return initialized;
  16114. }
  16115.  
  16116. </text>
  16117.     </content>
  16118.     <content>
  16119.         <layer>background</layer>
  16120.         <id>7</id>
  16121.         <text>146</text>
  16122.     </content>
  16123.     <content>
  16124.         <layer>background</layer>
  16125.         <id>4</id>
  16126.         <text>File 2 of 9:</text>
  16127.     </content>
  16128.     <name></name>
  16129.     <script></script>
  16130. </card>
  16131.  
  16132.  
  16133. card_72660.xml
  16134. <?xml version="1.0" encoding="utf-8" ?>
  16135. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  16136. <card>
  16137.     <id>72660</id>
  16138.     <filler1>0</filler1>
  16139.     <cantDelete> <false /> </cantDelete>
  16140.     <showPict> <true /> </showPict>
  16141.     <dontSearch> <false /> </dontSearch>
  16142.     <owner>4755</owner>
  16143.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  16144.     <part>
  16145.         <id>1</id>
  16146.         <type>field</type>
  16147.         <visible> <true /> </visible>
  16148.         <dontWrap> <false /> </dontWrap>
  16149.         <dontSearch> <false /> </dontSearch>
  16150.         <sharedText> <false /> </sharedText>
  16151.         <fixedLineHeight> <true /> </fixedLineHeight>
  16152.         <autoTab> <false /> </autoTab>
  16153.         <lockText> <false /> </lockText>
  16154.         <rect>
  16155.             <left>30</left>
  16156.             <top>78</top>
  16157.             <right>478</right>
  16158.             <bottom>296</bottom>
  16159.         </rect>
  16160.         <style>scrolling</style>
  16161.         <autoSelect> <false /> </autoSelect>
  16162.         <showLines> <false /> </showLines>
  16163.         <wideMargins> <false /> </wideMargins>
  16164.         <multipleLines> <false /> </multipleLines>
  16165.         <reservedFamily> 0 </reservedFamily>
  16166.         <titleWidth>0</titleWidth>
  16167.         <icon>0</icon>
  16168.         <textAlign>left</textAlign>
  16169.         <font>Monaco</font>
  16170.         <textSize>9</textSize>
  16171.         <textStyle>plain</textStyle>
  16172.         <textHeight>12</textHeight>
  16173.         <name>code</name>
  16174.         <script></script>
  16175.     </part>
  16176.     <part>
  16177.         <id>2</id>
  16178.         <type>button</type>
  16179.         <visible> <true /> </visible>
  16180.         <reserved5> 0 </reserved5>
  16181.         <reserved4> 0 </reserved4>
  16182.         <reserved3> 0 </reserved3>
  16183.         <reserved2> 0 </reserved2>
  16184.         <reserved1> 0 </reserved1>
  16185.         <enabled> <true /> </enabled>
  16186.         <rect>
  16187.             <left>169</left>
  16188.             <top>32</top>
  16189.             <right>305</right>
  16190.             <bottom>54</bottom>
  16191.         </rect>
  16192.         <style>roundrect</style>
  16193.         <showName> <true /> </showName>
  16194.         <highlight> <false /> </highlight>
  16195.         <autoHighlight> <true /> </autoHighlight>
  16196.         <sharedHighlight> <true /> </sharedHighlight>
  16197.         <family>0</family>
  16198.         <titleWidth>0</titleWidth>
  16199.         <icon>0</icon>
  16200.         <textAlign>center</textAlign>
  16201.         <font>Chicago</font>
  16202.         <textSize>12</textSize>
  16203.         <textStyle>plain</textStyle>
  16204.         <name>Copy to Clipboard</name>
  16205.         <script>on mouseUp
  16206. set lockscreen to true
  16207. select text of card field "code"
  16208. domenu "Copy Text"
  16209. select empty
  16210. set lockscreen to false
  16211. end mouseUp</script>
  16212.     </part>
  16213.     <content>
  16214.         <layer>card</layer>
  16215.         <id>1</id>
  16216.         <text>/*
  16217. *   FILE:    check.h
  16218. *   AUTHOR:  R.G.
  16219. *   CREATED: January 20, 1992
  16220. *   
  16221. *   Header defines Checkbook class
  16222. */
  16223.  
  16224. # ifndef check_h
  16225. # define check_h
  16226.  
  16227. # include "class.h"
  16228.  
  16229. /******************************************************************
  16230. *   Checkbook class
  16231. ******************************************************************/
  16232. class  Checkbook:public Generic_Class
  16233. {
  16234. private:
  16235.     float   balance;
  16236.  
  16237. public:
  16238.     Checkbook(void);
  16239.     void    withdraw(float);
  16240.     void    deposit(float);
  16241.     float   get_balance(void);
  16242. };
  16243.  
  16244. # endif
  16245. </text>
  16246.     </content>
  16247.     <content>
  16248.         <layer>background</layer>
  16249.         <id>7</id>
  16250.         <text>147</text>
  16251.     </content>
  16252.     <content>
  16253.         <layer>background</layer>
  16254.         <id>4</id>
  16255.         <text>File 3 of 9:</text>
  16256.     </content>
  16257.     <name></name>
  16258.     <script></script>
  16259. </card>
  16260.  
  16261.  
  16262. card_72852.xml
  16263. <?xml version="1.0" encoding="utf-8" ?>
  16264. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  16265. <card>
  16266.     <id>72852</id>
  16267.     <filler1>0</filler1>
  16268.     <cantDelete> <false /> </cantDelete>
  16269.     <showPict> <true /> </showPict>
  16270.     <dontSearch> <false /> </dontSearch>
  16271.     <owner>4755</owner>
  16272.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  16273.     <part>
  16274.         <id>1</id>
  16275.         <type>field</type>
  16276.         <visible> <true /> </visible>
  16277.         <dontWrap> <false /> </dontWrap>
  16278.         <dontSearch> <false /> </dontSearch>
  16279.         <sharedText> <false /> </sharedText>
  16280.         <fixedLineHeight> <true /> </fixedLineHeight>
  16281.         <autoTab> <false /> </autoTab>
  16282.         <lockText> <false /> </lockText>
  16283.         <rect>
  16284.             <left>30</left>
  16285.             <top>78</top>
  16286.             <right>478</right>
  16287.             <bottom>296</bottom>
  16288.         </rect>
  16289.         <style>scrolling</style>
  16290.         <autoSelect> <false /> </autoSelect>
  16291.         <showLines> <false /> </showLines>
  16292.         <wideMargins> <false /> </wideMargins>
  16293.         <multipleLines> <false /> </multipleLines>
  16294.         <reservedFamily> 0 </reservedFamily>
  16295.         <titleWidth>0</titleWidth>
  16296.         <icon>0</icon>
  16297.         <textAlign>left</textAlign>
  16298.         <font>Monaco</font>
  16299.         <textSize>9</textSize>
  16300.         <textStyle>plain</textStyle>
  16301.         <textHeight>12</textHeight>
  16302.         <name>code</name>
  16303.         <script></script>
  16304.     </part>
  16305.     <part>
  16306.         <id>2</id>
  16307.         <type>button</type>
  16308.         <visible> <true /> </visible>
  16309.         <reserved5> 0 </reserved5>
  16310.         <reserved4> 0 </reserved4>
  16311.         <reserved3> 0 </reserved3>
  16312.         <reserved2> 0 </reserved2>
  16313.         <reserved1> 0 </reserved1>
  16314.         <enabled> <true /> </enabled>
  16315.         <rect>
  16316.             <left>169</left>
  16317.             <top>32</top>
  16318.             <right>305</right>
  16319.             <bottom>54</bottom>
  16320.         </rect>
  16321.         <style>roundrect</style>
  16322.         <showName> <true /> </showName>
  16323.         <highlight> <false /> </highlight>
  16324.         <autoHighlight> <true /> </autoHighlight>
  16325.         <sharedHighlight> <true /> </sharedHighlight>
  16326.         <family>0</family>
  16327.         <titleWidth>0</titleWidth>
  16328.         <icon>0</icon>
  16329.         <textAlign>center</textAlign>
  16330.         <font>Chicago</font>
  16331.         <textSize>12</textSize>
  16332.         <textStyle>plain</textStyle>
  16333.         <name>Copy to Clipboard</name>
  16334.         <script>on mouseUp
  16335. set lockscreen to true
  16336. select text of card field "code"
  16337. domenu "Copy Text"
  16338. select empty
  16339. set lockscreen to false
  16340. end mouseUp</script>
  16341.     </part>
  16342.     <content>
  16343.         <layer>card</layer>
  16344.         <id>1</id>
  16345.         <text>/*
  16346. *   FILE:    check.c
  16347. *   AUTHOR:  R.G.
  16348. *   CREATED: January 20, 1992
  16349. *   
  16350. *   Define methods for Checkbook
  16351. */
  16352.  
  16353. # include "check.h"
  16354.  
  16355. /******************************************************************
  16356. *   Checkbook constructor.  In Think C, instance variables are by
  16357. *   default initialized to zero or NULL.  This cannot be counted on
  16358. *   in C++, and in either case shouldn't be relied on for reasons
  16359. *   of style.
  16360. ******************************************************************/
  16361. Checkbook::Checkbook(void)
  16362. {
  16363.     balance = 0.;
  16364. }
  16365.  
  16366. /******************************************************************
  16367. *   Withdrawal.
  16368. ******************************************************************/
  16369. void  Checkbook::withdraw(float amount)
  16370. {
  16371.     balance = balance - amount;
  16372. }
  16373.  
  16374. /******************************************************************
  16375. *   Deposit.
  16376. ******************************************************************/
  16377. void  Checkbook::deposit(float amount)
  16378. {
  16379.     balance = balance + amount;
  16380. }
  16381.  
  16382. /******************************************************************
  16383. *   Balance.
  16384. ******************************************************************/
  16385. float Checkbook::get_balance(void)
  16386. {
  16387.     return balance;
  16388. }
  16389.  
  16390. </text>
  16391.     </content>
  16392.     <content>
  16393.         <layer>background</layer>
  16394.         <id>7</id>
  16395.         <text>148</text>
  16396.     </content>
  16397.     <content>
  16398.         <layer>background</layer>
  16399.         <id>4</id>
  16400.         <text>File 4 of 9:</text>
  16401.     </content>
  16402.     <name></name>
  16403.     <script></script>
  16404. </card>
  16405.  
  16406.  
  16407. card_41729.xml
  16408. <?xml version="1.0" encoding="utf-8" ?>
  16409. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  16410. <card>
  16411.     <id>41729</id>
  16412.     <filler1>0</filler1>
  16413.     <cantDelete> <false /> </cantDelete>
  16414.     <showPict> <true /> </showPict>
  16415.     <dontSearch> <false /> </dontSearch>
  16416.     <owner>4755</owner>
  16417.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  16418.     <part>
  16419.         <id>1</id>
  16420.         <type>field</type>
  16421.         <visible> <true /> </visible>
  16422.         <dontWrap> <false /> </dontWrap>
  16423.         <dontSearch> <false /> </dontSearch>
  16424.         <sharedText> <false /> </sharedText>
  16425.         <fixedLineHeight> <true /> </fixedLineHeight>
  16426.         <autoTab> <false /> </autoTab>
  16427.         <lockText> <false /> </lockText>
  16428.         <rect>
  16429.             <left>30</left>
  16430.             <top>78</top>
  16431.             <right>478</right>
  16432.             <bottom>296</bottom>
  16433.         </rect>
  16434.         <style>scrolling</style>
  16435.         <autoSelect> <false /> </autoSelect>
  16436.         <showLines> <false /> </showLines>
  16437.         <wideMargins> <false /> </wideMargins>
  16438.         <multipleLines> <false /> </multipleLines>
  16439.         <reservedFamily> 0 </reservedFamily>
  16440.         <titleWidth>0</titleWidth>
  16441.         <icon>0</icon>
  16442.         <textAlign>left</textAlign>
  16443.         <font>Monaco</font>
  16444.         <textSize>9</textSize>
  16445.         <textStyle>plain</textStyle>
  16446.         <textHeight>12</textHeight>
  16447.         <name>code</name>
  16448.         <script></script>
  16449.     </part>
  16450.     <part>
  16451.         <id>2</id>
  16452.         <type>button</type>
  16453.         <visible> <true /> </visible>
  16454.         <reserved5> 0 </reserved5>
  16455.         <reserved4> 0 </reserved4>
  16456.         <reserved3> 0 </reserved3>
  16457.         <reserved2> 0 </reserved2>
  16458.         <reserved1> 0 </reserved1>
  16459.         <enabled> <true /> </enabled>
  16460.         <rect>
  16461.             <left>169</left>
  16462.             <top>32</top>
  16463.             <right>305</right>
  16464.             <bottom>54</bottom>
  16465.         </rect>
  16466.         <style>roundrect</style>
  16467.         <showName> <true /> </showName>
  16468.         <highlight> <false /> </highlight>
  16469.         <autoHighlight> <true /> </autoHighlight>
  16470.         <sharedHighlight> <true /> </sharedHighlight>
  16471.         <family>0</family>
  16472.         <titleWidth>0</titleWidth>
  16473.         <icon>0</icon>
  16474.         <textAlign>center</textAlign>
  16475.         <font>Chicago</font>
  16476.         <textSize>12</textSize>
  16477.         <textStyle>plain</textStyle>
  16478.         <name>Copy to Clipboard</name>
  16479.         <script>on mouseUp
  16480. set lockscreen to true
  16481. select text of card field "code"
  16482. domenu "Copy Text"
  16483. select empty
  16484. set lockscreen to false
  16485. end mouseUp</script>
  16486.     </part>
  16487.     <content>
  16488.         <layer>card</layer>
  16489.         <id>1</id>
  16490.         <text>/*
  16491. *   FILE:    person.h
  16492. *   AUTHOR:  R.G.
  16493. *   CREATED: January 20, 1992
  16494. *   
  16495. *   Header defines Person class
  16496. */
  16497.  
  16498. # ifndef person_h
  16499. # define person_h
  16500.  
  16501. # include "class.h"
  16502. # include "check.h"
  16503.  
  16504. /******************************************************************
  16505. *   Person class
  16506. ******************************************************************/
  16507. class  Person:public Generic_Class
  16508. {
  16509. private:
  16510.     char      *name;
  16511.     float     salary;
  16512.     Checkbook *checkbook;
  16513.  
  16514. public:
  16515.     Person(void);
  16516.     virtual void    set(void);
  16517.     virtual void    print(void);
  16518.     void            payday(void);
  16519.     virtual ~Person(void);
  16520. };
  16521.  
  16522. # endif
  16523. </text>
  16524.     </content>
  16525.     <content>
  16526.         <layer>background</layer>
  16527.         <id>7</id>
  16528.         <text>149</text>
  16529.     </content>
  16530.     <content>
  16531.         <layer>background</layer>
  16532.         <id>4</id>
  16533.         <text>File 5 of 9:</text>
  16534.     </content>
  16535.     <name></name>
  16536.     <script></script>
  16537. </card>
  16538.  
  16539.  
  16540. card_41536.xml
  16541. <?xml version="1.0" encoding="utf-8" ?>
  16542. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  16543. <card>
  16544.     <id>41536</id>
  16545.     <filler1>0</filler1>
  16546.     <cantDelete> <false /> </cantDelete>
  16547.     <showPict> <true /> </showPict>
  16548.     <dontSearch> <false /> </dontSearch>
  16549.     <owner>4755</owner>
  16550.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  16551.     <part>
  16552.         <id>1</id>
  16553.         <type>field</type>
  16554.         <visible> <true /> </visible>
  16555.         <dontWrap> <false /> </dontWrap>
  16556.         <dontSearch> <false /> </dontSearch>
  16557.         <sharedText> <false /> </sharedText>
  16558.         <fixedLineHeight> <true /> </fixedLineHeight>
  16559.         <autoTab> <false /> </autoTab>
  16560.         <lockText> <false /> </lockText>
  16561.         <rect>
  16562.             <left>30</left>
  16563.             <top>78</top>
  16564.             <right>478</right>
  16565.             <bottom>296</bottom>
  16566.         </rect>
  16567.         <style>scrolling</style>
  16568.         <autoSelect> <false /> </autoSelect>
  16569.         <showLines> <false /> </showLines>
  16570.         <wideMargins> <false /> </wideMargins>
  16571.         <multipleLines> <false /> </multipleLines>
  16572.         <reservedFamily> 0 </reservedFamily>
  16573.         <titleWidth>0</titleWidth>
  16574.         <icon>0</icon>
  16575.         <textAlign>left</textAlign>
  16576.         <font>Monaco</font>
  16577.         <textSize>9</textSize>
  16578.         <textStyle>plain</textStyle>
  16579.         <textHeight>12</textHeight>
  16580.         <name>code</name>
  16581.         <script></script>
  16582.     </part>
  16583.     <part>
  16584.         <id>2</id>
  16585.         <type>button</type>
  16586.         <visible> <true /> </visible>
  16587.         <reserved5> 0 </reserved5>
  16588.         <reserved4> 0 </reserved4>
  16589.         <reserved3> 0 </reserved3>
  16590.         <reserved2> 0 </reserved2>
  16591.         <reserved1> 0 </reserved1>
  16592.         <enabled> <true /> </enabled>
  16593.         <rect>
  16594.             <left>169</left>
  16595.             <top>32</top>
  16596.             <right>305</right>
  16597.             <bottom>54</bottom>
  16598.         </rect>
  16599.         <style>roundrect</style>
  16600.         <showName> <true /> </showName>
  16601.         <highlight> <false /> </highlight>
  16602.         <autoHighlight> <true /> </autoHighlight>
  16603.         <sharedHighlight> <true /> </sharedHighlight>
  16604.         <family>0</family>
  16605.         <titleWidth>0</titleWidth>
  16606.         <icon>0</icon>
  16607.         <textAlign>center</textAlign>
  16608.         <font>Chicago</font>
  16609.         <textSize>12</textSize>
  16610.         <textStyle>plain</textStyle>
  16611.         <name>Copy to Clipboard</name>
  16612.         <script>on mouseUp
  16613. set lockscreen to true
  16614. select text of card field "code"
  16615. domenu "Copy Text"
  16616. select empty
  16617. set lockscreen to false
  16618. end mouseUp</script>
  16619.     </part>
  16620.     <content>
  16621.         <layer>card</layer>
  16622.         <id>1</id>
  16623.         <text>/*
  16624. *   FILE:    person.c
  16625. *   AUTHOR:  R.G.
  16626. *   CREATED: January 20, 1992
  16627. *   
  16628. *   Define Person methods
  16629. */
  16630.  
  16631. # include "person.h"
  16632. # include <stdio.h>      // declares printf(), scanf() 
  16633. # include <string.h>     // declares strlen(), strcpy() 
  16634. # include <stdlib.h>     // declares malloc(), free()
  16635.  
  16636. /******************************************************************
  16637. *   Constructor.
  16638. ******************************************************************/
  16639. Person::Person(void)
  16640. {
  16641.     name = NULL;
  16642.     salary = 0.;
  16643.     
  16644.     checkbook = new Checkbook;
  16645.     // Evaluation is left-to-right until FALSE is found:
  16646.     initialized = initialized &&
  16647.         (checkbook != NULL) && checkbook->is_initialized();
  16648.     
  16649. /*  Alternative logic:
  16650.     checkbook = NULL;
  16651.     if (initialized)
  16652.     {
  16653.         checkbook = new Checkbook;
  16654.         if (checkbook != NULL && checkbook->is_initialized())
  16655.             initialized = TRUE;
  16656.         else
  16657.             initialized = FALSE;
  16658.     }
  16659. */
  16660. }
  16661.  
  16662. /******************************************************************
  16663. *   Set Person
  16664. ******************************************************************/
  16665. void    Person::set(void)
  16666. {
  16667.     char    temp_name[80];
  16668.     float   temp_salary;
  16669.  
  16670.     printf("Enter name (no spaces):\n");
  16671.     scanf("%s",temp_name);
  16672.  
  16673. //  malloc allocates space for string plus '\0' null character,
  16674. //  if available (else returns NULL):
  16675.  
  16676.     name = malloc(sizeof(char) * (strlen(temp_name)+1));
  16677.     if (name != NULL)
  16678.         strcpy(name,temp_name); // TC "shadowing" not needed since
  16679.                                 //  malloc() allocates immobile space
  16680.  
  16681.     printf("Enter salary:\n");
  16682.     scanf("%g",&temp_salary);      // "shadowing" for TC safety
  16683.     salary = temp_salary;
  16684. }
  16685.  
  16686. /******************************************************************
  16687. *   Print Person
  16688. ******************************************************************/
  16689. void    Person::print(void)
  16690. {
  16691.     printf("Name: %s\n",name);
  16692.     printf("Checking balance: %g\n",checkbook->get_balance());
  16693. }
  16694.  
  16695. /******************************************************************
  16696. *   Pay Person
  16697. ******************************************************************/
  16698. void    Person::payday(void)
  16699. {
  16700.     checkbook->deposit(salary);
  16701. }
  16702.  
  16703. /******************************************************************
  16704. *   Destructor
  16705. ******************************************************************/
  16706. Person::~Person(void)
  16707. {
  16708.     free(name);   // ok if name is allocated or NULL
  16709.     delete checkbook;  // ok if checkbook is allocated or NULL
  16710. }
  16711.  
  16712.  
  16713.  
  16714. </text>
  16715.     </content>
  16716.     <content>
  16717.         <layer>background</layer>
  16718.         <id>7</id>
  16719.         <text>150</text>
  16720.     </content>
  16721.     <content>
  16722.         <layer>background</layer>
  16723.         <id>4</id>
  16724.         <text>File 6 of 9:</text>
  16725.     </content>
  16726.     <name></name>
  16727.     <script></script>
  16728. </card>
  16729.  
  16730.  
  16731. card_41262.xml
  16732. <?xml version="1.0" encoding="utf-8" ?>
  16733. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  16734. <card>
  16735.     <id>41262</id>
  16736.     <filler1>0</filler1>
  16737.     <cantDelete> <false /> </cantDelete>
  16738.     <showPict> <true /> </showPict>
  16739.     <dontSearch> <false /> </dontSearch>
  16740.     <owner>4755</owner>
  16741.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  16742.     <part>
  16743.         <id>1</id>
  16744.         <type>field</type>
  16745.         <visible> <true /> </visible>
  16746.         <dontWrap> <false /> </dontWrap>
  16747.         <dontSearch> <false /> </dontSearch>
  16748.         <sharedText> <false /> </sharedText>
  16749.         <fixedLineHeight> <true /> </fixedLineHeight>
  16750.         <autoTab> <false /> </autoTab>
  16751.         <lockText> <false /> </lockText>
  16752.         <rect>
  16753.             <left>30</left>
  16754.             <top>78</top>
  16755.             <right>478</right>
  16756.             <bottom>296</bottom>
  16757.         </rect>
  16758.         <style>scrolling</style>
  16759.         <autoSelect> <false /> </autoSelect>
  16760.         <showLines> <false /> </showLines>
  16761.         <wideMargins> <false /> </wideMargins>
  16762.         <multipleLines> <false /> </multipleLines>
  16763.         <reservedFamily> 0 </reservedFamily>
  16764.         <titleWidth>0</titleWidth>
  16765.         <icon>0</icon>
  16766.         <textAlign>left</textAlign>
  16767.         <font>Monaco</font>
  16768.         <textSize>9</textSize>
  16769.         <textStyle>plain</textStyle>
  16770.         <textHeight>12</textHeight>
  16771.         <name>code</name>
  16772.         <script></script>
  16773.     </part>
  16774.     <part>
  16775.         <id>2</id>
  16776.         <type>button</type>
  16777.         <visible> <true /> </visible>
  16778.         <reserved5> 0 </reserved5>
  16779.         <reserved4> 0 </reserved4>
  16780.         <reserved3> 0 </reserved3>
  16781.         <reserved2> 0 </reserved2>
  16782.         <reserved1> 0 </reserved1>
  16783.         <enabled> <true /> </enabled>
  16784.         <rect>
  16785.             <left>169</left>
  16786.             <top>32</top>
  16787.             <right>305</right>
  16788.             <bottom>54</bottom>
  16789.         </rect>
  16790.         <style>roundrect</style>
  16791.         <showName> <true /> </showName>
  16792.         <highlight> <false /> </highlight>
  16793.         <autoHighlight> <true /> </autoHighlight>
  16794.         <sharedHighlight> <true /> </sharedHighlight>
  16795.         <family>0</family>
  16796.         <titleWidth>0</titleWidth>
  16797.         <icon>0</icon>
  16798.         <textAlign>center</textAlign>
  16799.         <font>Chicago</font>
  16800.         <textSize>12</textSize>
  16801.         <textStyle>plain</textStyle>
  16802.         <name>Copy to Clipboard</name>
  16803.         <script>on mouseUp
  16804. set lockscreen to true
  16805. select text of card field "code"
  16806. domenu "Copy Text"
  16807. select empty
  16808. set lockscreen to false
  16809. end mouseUp</script>
  16810.     </part>
  16811.     <content>
  16812.         <layer>card</layer>
  16813.         <id>1</id>
  16814.         <text>/*
  16815. *   FILE:    student.h
  16816. *   AUTHOR:  R.G.
  16817. *   CREATED: January 20, 1992
  16818. *   
  16819. *   Header for Student class
  16820. */
  16821.  
  16822. # ifndef student_h
  16823. # define student_h
  16824.  
  16825. # include "person.h"
  16826.  
  16827. /******************************************************************
  16828. *   Derive Student class from Person
  16829. ******************************************************************/
  16830. class   Student:public Person
  16831. {
  16832. private:
  16833.     char    *academic_year;
  16834.  
  16835. public:
  16836.     Student(void);
  16837.     virtual void    set(void);  
  16838.     virtual void    print(void);
  16839.     virtual ~Student(void);
  16840. };
  16841.  
  16842. # endif
  16843.  
  16844. </text>
  16845.     </content>
  16846.     <content>
  16847.         <layer>background</layer>
  16848.         <id>7</id>
  16849.         <text>151</text>
  16850.     </content>
  16851.     <content>
  16852.         <layer>background</layer>
  16853.         <id>4</id>
  16854.         <text>File 7 of 9:</text>
  16855.     </content>
  16856.     <name></name>
  16857.     <script></script>
  16858. </card>
  16859.  
  16860.  
  16861. card_42911.xml
  16862. <?xml version="1.0" encoding="utf-8" ?>
  16863. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  16864. <card>
  16865.     <id>42911</id>
  16866.     <filler1>0</filler1>
  16867.     <cantDelete> <false /> </cantDelete>
  16868.     <showPict> <true /> </showPict>
  16869.     <dontSearch> <false /> </dontSearch>
  16870.     <owner>4755</owner>
  16871.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  16872.     <part>
  16873.         <id>1</id>
  16874.         <type>field</type>
  16875.         <visible> <true /> </visible>
  16876.         <dontWrap> <false /> </dontWrap>
  16877.         <dontSearch> <false /> </dontSearch>
  16878.         <sharedText> <false /> </sharedText>
  16879.         <fixedLineHeight> <true /> </fixedLineHeight>
  16880.         <autoTab> <false /> </autoTab>
  16881.         <lockText> <false /> </lockText>
  16882.         <rect>
  16883.             <left>30</left>
  16884.             <top>78</top>
  16885.             <right>478</right>
  16886.             <bottom>296</bottom>
  16887.         </rect>
  16888.         <style>scrolling</style>
  16889.         <autoSelect> <false /> </autoSelect>
  16890.         <showLines> <false /> </showLines>
  16891.         <wideMargins> <false /> </wideMargins>
  16892.         <multipleLines> <false /> </multipleLines>
  16893.         <reservedFamily> 0 </reservedFamily>
  16894.         <titleWidth>0</titleWidth>
  16895.         <icon>0</icon>
  16896.         <textAlign>left</textAlign>
  16897.         <font>Monaco</font>
  16898.         <textSize>9</textSize>
  16899.         <textStyle>plain</textStyle>
  16900.         <textHeight>12</textHeight>
  16901.         <name>code</name>
  16902.         <script></script>
  16903.     </part>
  16904.     <part>
  16905.         <id>2</id>
  16906.         <type>button</type>
  16907.         <visible> <true /> </visible>
  16908.         <reserved5> 0 </reserved5>
  16909.         <reserved4> 0 </reserved4>
  16910.         <reserved3> 0 </reserved3>
  16911.         <reserved2> 0 </reserved2>
  16912.         <reserved1> 0 </reserved1>
  16913.         <enabled> <true /> </enabled>
  16914.         <rect>
  16915.             <left>169</left>
  16916.             <top>32</top>
  16917.             <right>305</right>
  16918.             <bottom>54</bottom>
  16919.         </rect>
  16920.         <style>roundrect</style>
  16921.         <showName> <true /> </showName>
  16922.         <highlight> <false /> </highlight>
  16923.         <autoHighlight> <true /> </autoHighlight>
  16924.         <sharedHighlight> <true /> </sharedHighlight>
  16925.         <family>0</family>
  16926.         <titleWidth>0</titleWidth>
  16927.         <icon>0</icon>
  16928.         <textAlign>center</textAlign>
  16929.         <font>Chicago</font>
  16930.         <textSize>12</textSize>
  16931.         <textStyle>plain</textStyle>
  16932.         <name>Copy to Clipboard</name>
  16933.         <script>on mouseUp
  16934. set lockscreen to true
  16935. select text of card field "code"
  16936. domenu "Copy Text"
  16937. select empty
  16938. set lockscreen to false
  16939. end mouseUp</script>
  16940.     </part>
  16941.     <content>
  16942.         <layer>card</layer>
  16943.         <id>1</id>
  16944.         <text>/*
  16945. *   FILE:    student.c
  16946. *   AUTHOR:  R.G.
  16947. *   CREATED: January 20, 1992
  16948. *   
  16949. *   Student methods
  16950. */
  16951.  
  16952. # include "student.h"
  16953. # include <stdio.h>
  16954. # include <string.h>
  16955. # include <stdlib.h>
  16956. # define  MAX_AC_YEAR  20
  16957.  
  16958. /******************************************************************
  16959. *   Constructor.
  16960. ******************************************************************/
  16961. Student::Student(void)
  16962. {
  16963.     academic_year = malloc(sizeof(char) * (MAX_AC_YEAR+1));
  16964.     initialized = initialized && (academic_year != NULL);
  16965. }
  16966.  
  16967. /******************************************************************
  16968. *   Override set()
  16969. ******************************************************************/
  16970. void    Student::set(void)
  16971. {
  16972.     Person::set();   // in TC, may use:  inherited::set() 
  16973.     
  16974.     printf("Enter academic year (freshman, sophomore, etc.):\n");
  16975.     scanf("%s",academic_year);
  16976. }
  16977.  
  16978. /******************************************************************
  16979. *   Override print()
  16980. ******************************************************************/
  16981. void    Student::print(void)
  16982. {
  16983.     Person::print();  // in TC, may use:  inherited::print() 
  16984.  
  16985.     printf("Academic year: %s\n",academic_year);
  16986. }
  16987.  
  16988. /******************************************************************
  16989. *   Destructor
  16990. ******************************************************************/
  16991. Student::~Student(void)
  16992. {
  16993.     free(academic_year);
  16994. }
  16995.  
  16996. </text>
  16997.     </content>
  16998.     <content>
  16999.         <layer>background</layer>
  17000.         <id>7</id>
  17001.         <text>152</text>
  17002.     </content>
  17003.     <content>
  17004.         <layer>background</layer>
  17005.         <id>4</id>
  17006.         <text>File 8 of 9:</text>
  17007.     </content>
  17008.     <name></name>
  17009.     <script></script>
  17010. </card>
  17011.  
  17012.  
  17013. card_41200.xml
  17014. <?xml version="1.0" encoding="utf-8" ?>
  17015. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17016. <card>
  17017.     <id>41200</id>
  17018.     <filler1>0</filler1>
  17019.     <cantDelete> <false /> </cantDelete>
  17020.     <showPict> <true /> </showPict>
  17021.     <dontSearch> <false /> </dontSearch>
  17022.     <owner>4755</owner>
  17023.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17024.     <part>
  17025.         <id>1</id>
  17026.         <type>field</type>
  17027.         <visible> <true /> </visible>
  17028.         <dontWrap> <false /> </dontWrap>
  17029.         <dontSearch> <false /> </dontSearch>
  17030.         <sharedText> <false /> </sharedText>
  17031.         <fixedLineHeight> <true /> </fixedLineHeight>
  17032.         <autoTab> <false /> </autoTab>
  17033.         <lockText> <false /> </lockText>
  17034.         <rect>
  17035.             <left>30</left>
  17036.             <top>78</top>
  17037.             <right>478</right>
  17038.             <bottom>296</bottom>
  17039.         </rect>
  17040.         <style>scrolling</style>
  17041.         <autoSelect> <false /> </autoSelect>
  17042.         <showLines> <false /> </showLines>
  17043.         <wideMargins> <false /> </wideMargins>
  17044.         <multipleLines> <false /> </multipleLines>
  17045.         <reservedFamily> 0 </reservedFamily>
  17046.         <titleWidth>0</titleWidth>
  17047.         <icon>0</icon>
  17048.         <textAlign>left</textAlign>
  17049.         <font>Monaco</font>
  17050.         <textSize>9</textSize>
  17051.         <textStyle>plain</textStyle>
  17052.         <textHeight>12</textHeight>
  17053.         <name>code</name>
  17054.         <script></script>
  17055.     </part>
  17056.     <part>
  17057.         <id>2</id>
  17058.         <type>button</type>
  17059.         <visible> <true /> </visible>
  17060.         <reserved5> 0 </reserved5>
  17061.         <reserved4> 0 </reserved4>
  17062.         <reserved3> 0 </reserved3>
  17063.         <reserved2> 0 </reserved2>
  17064.         <reserved1> 0 </reserved1>
  17065.         <enabled> <true /> </enabled>
  17066.         <rect>
  17067.             <left>169</left>
  17068.             <top>32</top>
  17069.             <right>305</right>
  17070.             <bottom>54</bottom>
  17071.         </rect>
  17072.         <style>roundrect</style>
  17073.         <showName> <true /> </showName>
  17074.         <highlight> <false /> </highlight>
  17075.         <autoHighlight> <true /> </autoHighlight>
  17076.         <sharedHighlight> <true /> </sharedHighlight>
  17077.         <family>0</family>
  17078.         <titleWidth>0</titleWidth>
  17079.         <icon>0</icon>
  17080.         <textAlign>center</textAlign>
  17081.         <font>Chicago</font>
  17082.         <textSize>12</textSize>
  17083.         <textStyle>plain</textStyle>
  17084.         <name>Copy to Clipboard</name>
  17085.         <script>on mouseUp
  17086. set lockscreen to true
  17087. select text of card field "code"
  17088. domenu "Copy Text"
  17089. select empty
  17090. set lockscreen to false
  17091. end mouseUp</script>
  17092.     </part>
  17093.     <content>
  17094.         <layer>card</layer>
  17095.         <id>1</id>
  17096.         <text>/*
  17097. *   FILE:    main.c
  17098. *   AUTHOR:  R.G.
  17099. *   CREATED: January 20, 1992
  17100. *   
  17101. *   main() function for class example
  17102. *
  17103. *   PROJECT CONTENTS:
  17104. *   class.c, check.c, person.c, student.c, main.c
  17105. *   (For Think C, add the ANSI and oops libraries.)
  17106. */
  17107.  
  17108. # include "person.h"
  17109. # include "student.h"
  17110. # include <stdio.h>
  17111.  
  17112. char    get_choice(void);   // prototype for later definition 
  17113.  
  17114. /******************************************************************
  17115. *   main() function
  17116. ******************************************************************/
  17117. main()
  17118. {
  17119.     Person  *person[100];   // array of Person-pointers 
  17120.     char    response;
  17121.     int     i = 0,
  17122.             j;
  17123.     boolean out_of_memory = FALSE;
  17124.  
  17125.     while (i<100 && !out_of_memory && ((response=get_choice())!='x'))
  17126.     {
  17127.         if (response == 'p')
  17128.             person[i] = new Person;
  17129.         else if (response == 's')
  17130.             person[i] = new Student;
  17131.  
  17132.         if (response == 'p' || response == 's')
  17133.         {
  17134.             if (person[i] != NULL && person[i]->is_initialized())
  17135.                 i++;
  17136.             else
  17137.             {
  17138.                 out_of_memory = TRUE;
  17139.                 delete person[i];
  17140.                 printf("Can't allocate person #%d!\n",i);
  17141.             }
  17142.         }
  17143.     }
  17144.  
  17145.     for (j=0 ; j<i ; j++)
  17146.     {
  17147.         printf("\nPerson #%d data:\n",j);
  17148.         person[j]->set();
  17149.     }
  17150.  
  17151.     for (j=0 ; j<i ; j++)
  17152.     {
  17153.         person[j]->payday();
  17154.         person[j]->payday();
  17155.         printf("\nPerson #%d status after 2 paydays:\n",j);
  17156.         person[j]->print();
  17157.         delete person[j];
  17158.     }
  17159. }
  17160.  
  17161. /******************************************************************
  17162. *   function to get choice from user
  17163. ******************************************************************/
  17164. char    get_choice(void)
  17165. {
  17166.     char    response,
  17167.             junk;
  17168.  
  17169.     printf("Add a person (p), student (s), or exit (x):\n");
  17170.     scanf("%c",&response);
  17171.     scanf("%c",&junk);       // get unneeded linefeed character 
  17172.     return response;
  17173. }
  17174.  
  17175. </text>
  17176.     </content>
  17177.     <content>
  17178.         <layer>background</layer>
  17179.         <id>7</id>
  17180.         <text>153</text>
  17181.     </content>
  17182.     <content>
  17183.         <layer>background</layer>
  17184.         <id>4</id>
  17185.         <text>File 9 of 9:
  17186.  
  17187.  
  17188.  
  17189.  
  17190.  
  17191.  
  17192.  
  17193.  
  17194.  
  17195. </text>
  17196.     </content>
  17197.     <name></name>
  17198.     <script></script>
  17199. </card>
  17200.  
  17201.  
  17202. card_40553.xml
  17203. <?xml version="1.0" encoding="utf-8" ?>
  17204. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17205. <card>
  17206.     <id>40553</id>
  17207.     <filler1>0</filler1>
  17208.     <cantDelete> <false /> </cantDelete>
  17209.     <showPict> <true /> </showPict>
  17210.     <dontSearch> <false /> </dontSearch>
  17211.     <owner>4755</owner>
  17212.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17213.     <content>
  17214.         <layer>background</layer>
  17215.         <id>6</id>
  17216.         <text>4.7  More C++ Features</text>
  17217.     </content>
  17218.     <content>
  17219.         <layer>background</layer>
  17220.         <id>4</id>
  17221.         <text>There are a few additional C++ features which have recently been added to Think C, though their use is not mandatory for writing good object-oriented programs.  These are discussed very briefly in this section, and the reader is referred to the Think C manuals or to another C++ reference* for more details.
  17222.  
  17223. If you are writing programs in a C++ environment, you may also wish to investigate the many additional features not available in Think C.  Again, these features are not mandatory for using C++, but may prove useful in large projects.  Appendix 2 lists these features.</text>
  17224.     </content>
  17225.     <content>
  17226.         <layer>background</layer>
  17227.         <id>29</id>
  17228.         <text>2231</text>
  17229.     </content>
  17230.     <content>
  17231.         <layer>background</layer>
  17232.         <id>27</id>
  17233.         <text>Bibliography</text>
  17234.     </content>
  17235.     <content>
  17236.         <layer>background</layer>
  17237.         <id>20</id>
  17238.         <text>Bibliography - p259</text>
  17239.     </content>
  17240.     <content>
  17241.         <layer>background</layer>
  17242.         <id>7</id>
  17243.         <text>154</text>
  17244.     </content>
  17245.     <name></name>
  17246.     <script></script>
  17247. </card>
  17248.  
  17249.  
  17250. card_69749.xml
  17251. <?xml version="1.0" encoding="utf-8" ?>
  17252. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17253. <card>
  17254.     <id>69749</id>
  17255.     <filler1>0</filler1>
  17256.     <cantDelete> <false /> </cantDelete>
  17257.     <showPict> <true /> </showPict>
  17258.     <dontSearch> <false /> </dontSearch>
  17259.     <owner>4755</owner>
  17260.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17261.     <content>
  17262.         <layer>background</layer>
  17263.         <id>4</id>
  17264.         <text><span class="style3">TATIC MEMBERS
  17265.  
  17266. A </span><span class="style7">class variable</span><span class="style3"> is a variable declared in a class definition, using the </span><span class="style4">static</span><span class="style3"> specifier.  Only one "instance" of this variable exists, shared by all objects of this class.  Thus class variables are useful for maintaining values through which common objects may communicate, in a "bulletin board" fashion.  Since a class variable is not allocated when objects are allocated, it must be allocated separately as shown below.
  17267.  
  17268. Similarly, a </span><span class="style7">class method</span><span class="style3"> is a method declared using the </span><span class="style4">static</span><span class="style3"> specifier.  Since this method is not associated with any given object of the class, you cannot access the (non-static) instance variables of the class without explicitly providing an object reference.  Class methods usually serve as "utilities" for a given class.  Note that in Think C it is possible to take the address of a class method but not of other methods.
  17269.  
  17270. You must use the</span><span class="style4"> :: </span><span class="style3">scope resolution operator to identify the class of a class variable or a class method, though it may be omitted within the body of a class method of the same class.  For example*:
  17271. </span></text>
  17272.     </content>
  17273.     <content>
  17274.         <layer>background</layer>
  17275.         <id>7</id>
  17276.         <text>155</text>
  17277.     </content>
  17278.     <content>
  17279.         <layer>background</layer>
  17280.         <id>29</id>
  17281.         <text>46228</text>
  17282.     </content>
  17283.     <content>
  17284.         <layer>background</layer>
  17285.         <id>27</id>
  17286.         <text>Conditional (a?b:c) operator</text>
  17287.     </content>
  17288.     <content>
  17289.         <layer>background</layer>
  17290.         <id>20</id>
  17291.         <text>Conditional (a?b:c) operator - p171</text>
  17292.     </content>
  17293.     <name></name>
  17294.     <script></script>
  17295. </card>
  17296.  
  17297.  
  17298. card_73152.xml
  17299. <?xml version="1.0" encoding="utf-8" ?>
  17300. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17301. <card>
  17302.     <id>73152</id>
  17303.     <filler1>0</filler1>
  17304.     <cantDelete> <false /> </cantDelete>
  17305.     <showPict> <true /> </showPict>
  17306.     <dontSearch> <false /> </dontSearch>
  17307.     <owner>4755</owner>
  17308.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17309.     <content>
  17310.         <layer>background</layer>
  17311.         <id>4</id>
  17312.         <text><span class="style4">   class Student:public Person
  17313.     {
  17314.         static boolean no_students_are_sick;   // class variable
  17315.  
  17316.     public:
  17317.         void static check_wellness(void);      // class method
  17318.         ...
  17319.     };
  17320.  
  17321.     boolean Student::no_students_are_sick = TRUE;  // allocate class variable
  17322.  
  17323.     void Student::check_wellness(void)
  17324.     {
  17325.         printf("Wellness: %s\n",no_students_are_sick?"Good":"Bad");
  17326.     }
  17327.  
  17328.     main()
  17329.     {
  17330.         ...
  17331.         Student::check_wellness();
  17332.     }
  17333. </span></text>
  17334.     </content>
  17335.     <content>
  17336.         <layer>background</layer>
  17337.         <id>7</id>
  17338.         <text>156</text>
  17339.     </content>
  17340.     <name></name>
  17341.     <script></script>
  17342. </card>
  17343.  
  17344.  
  17345. card_70105.xml
  17346. <?xml version="1.0" encoding="utf-8" ?>
  17347. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17348. <card>
  17349.     <id>70105</id>
  17350.     <filler1>0</filler1>
  17351.     <cantDelete> <false /> </cantDelete>
  17352.     <showPict> <true /> </showPict>
  17353.     <dontSearch> <false /> </dontSearch>
  17354.     <owner>4755</owner>
  17355.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17356.     <content>
  17357.         <layer>background</layer>
  17358.         <id>4</id>
  17359.         <text><span class="style3">LLOCATORS & DEALLOCATORS
  17360.  
  17361. C++ allows you to "overload" an operator, so that its effect depends on the type you apply it to.  (This is similar to the polymorphism provided by virtual methods.)  In particular, it is occasionally useful to overload the </span><span class="style4">new</span><span class="style3"> and </span><span class="style4">delete</span><span class="style3"> operators to customize how a particular class is allocated and deallocated.  This is the </span><span class="style7">only</span><span class="style3"> case where operator overloading is supported in Think C.  The syntax is:
  17362. </span><span class="style4">
  17363.     class Student:Person
  17364.     {
  17365.         void* operator new(size_t);   // size_t is declared in <stddef.h>
  17366.         ...
  17367.     };
  17368.  
  17369.     void* Student::operator new(size_t num_bytes)
  17370.     {
  17371.         ...
  17372.     }</span></text>
  17373.     </content>
  17374.     <content>
  17375.         <layer>background</layer>
  17376.         <id>7</id>
  17377.         <text>157</text>
  17378.     </content>
  17379.     <name></name>
  17380.     <script></script>
  17381. </card>
  17382.  
  17383.  
  17384. card_38494.xml
  17385. <?xml version="1.0" encoding="utf-8" ?>
  17386. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17387. <card>
  17388.     <id>38494</id>
  17389.     <filler1>0</filler1>
  17390.     <cantDelete> <false /> </cantDelete>
  17391.     <showPict> <true /> </showPict>
  17392.     <dontSearch> <false /> </dontSearch>
  17393.     <owner>4755</owner>
  17394.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17395.     <content>
  17396.         <layer>background</layer>
  17397.         <id>6</id>
  17398.         <text>4.8  TC Indirect & Direct Objects</text>
  17399.     </content>
  17400.     <content>
  17401.         <layer>background</layer>
  17402.         <id>4</id>
  17403.         <text><span class="style3">his section does not apply to C++.  Most Think C classes are defined using the </span><span class="style4">indirect</span><span class="style3"> specifier, or are descended from a class using this specifier.  When a pointer to an object of this type is declared, the pointer is actually implemented as a </span><span class="style7">handle</span><span class="style3">.  Macintosh handles are pointers to pointers.  Using handles to refer to data allows the Macintosh memory management routines to dynamically restructure memory ("move memory") during program execution without disturbing the program.  Since the TC compiler is aware what identifiers refer to objects, it allows the programmer to treat the identifiers as simple pointers without concern for the actual implementation as handles.  There are a few situations, however, where awareness of this implementation is crucial.
  17404.  
  17405. Most significant is the rule:  </span><span class="style7">never rely upon the address of an instance variable during calls to functions which invoke memory management routines</span><span class="style3">.  The actual address may change during memory management due to the handle implementation, causing "inexplicable" program crashes.  Unfortunately many of TC's functions in the standard C libraries invoke memory management.  For example, in the </span><span class="style4">Person::set()</span><span class="style3"> method we may wish to read a value from the user</span></text>
  17406.     </content>
  17407.     <content>
  17408.         <layer>background</layer>
  17409.         <id>7</id>
  17410.         <text>158</text>
  17411.     </content>
  17412.     <name></name>
  17413.     <script></script>
  17414. </card>
  17415.  
  17416.  
  17417. card_39343.xml
  17418. <?xml version="1.0" encoding="utf-8" ?>
  17419. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17420. <card>
  17421.     <id>39343</id>
  17422.     <filler1>0</filler1>
  17423.     <cantDelete> <false /> </cantDelete>
  17424.     <showPict> <true /> </showPict>
  17425.     <dontSearch> <false /> </dontSearch>
  17426.     <owner>4755</owner>
  17427.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17428.     <content>
  17429.         <layer>background</layer>
  17430.         <id>4</id>
  17431.         <text><span class="style3">with the </span><span class="style4">scanf()</span><span class="style3"> library function, into the </span><span class="style4">salary</span><span class="style3"> instance variable:
  17432. </span><span class="style4">
  17433.     void    Person::set(void)
  17434.     {
  17435.         printf("Enter salary:\n");
  17436.         scanf("%g",&salary);    // may bomb in TC with 'indirect' object 
  17437.     }
  17438.  
  17439. scanf()</span><span class="style3"> accepts the address of a variable as an argument, reads a value from the keyboard, and assigns the value to the variable pointed to by the address.  If memory is moved, this action may overwrite important data used for another purpose.  To avoid this problem, TC recommends a "shadowing" technique using local variables:
  17440. </span><span class="style4">
  17441.     void    Person::set(void)
  17442.     {
  17443.         float     temp_salary;
  17444.         printf("Enter salary:\n");
  17445.         scanf("%g",&temp_salary);        // bomb-free approach 
  17446.         salary = temp_salary;
  17447.     }
  17448.  
  17449.  
  17450.  
  17451. </span></text>
  17452.     </content>
  17453.     <content>
  17454.         <layer>background</layer>
  17455.         <id>7</id>
  17456.         <text>159</text>
  17457.     </content>
  17458.     <content>
  17459.         <layer>background</layer>
  17460.         <id>18</id>
  17461.         <text>p251</text>
  17462.     </content>
  17463.     <name></name>
  17464.     <script></script>
  17465. </card>
  17466.  
  17467.  
  17468. card_39675.xml
  17469. <?xml version="1.0" encoding="utf-8" ?>
  17470. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17471. <card>
  17472.     <id>39675</id>
  17473.     <filler1>0</filler1>
  17474.     <cantDelete> <false /> </cantDelete>
  17475.     <showPict> <true /> </showPict>
  17476.     <dontSearch> <false /> </dontSearch>
  17477.     <owner>4755</owner>
  17478.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17479.     <content>
  17480.         <layer>background</layer>
  17481.         <id>4</id>
  17482.         <text><span class="style3">uppose a new instance variable is declared for the </span><span class="style4">Person</span><span class="style3"> class: a character array of length 80 called </span><span class="style4">name</span><span class="style3">.  Remember that array names are considered in C to represent the address of the first element of the array.  Therefore the following use of the standard string copy function may also cause program bombs:
  17483. </span><span class="style4">
  17484.     void   Person::set(void)
  17485.     {
  17486.         strcpy(name,"Jack Knapp");    // may cause bombs in TC 
  17487.     }
  17488.     
  17489. </span><span class="style3">Instead, the programmer must assign each character one by one (or write a string-copy function which doesn't move memory):
  17490. </span><span class="style4">
  17491.     name[0] = 'J';
  17492.     name[1] = 'a';
  17493.              .
  17494.              .
  17495. </span></text>
  17496.     </content>
  17497.     <content>
  17498.         <layer>background</layer>
  17499.         <id>7</id>
  17500.         <text>160</text>
  17501.     </content>
  17502.     <content>
  17503.         <layer>background</layer>
  17504.         <id>18</id>
  17505.         <text>p251</text>
  17506.     </content>
  17507.     <name></name>
  17508.     <script></script>
  17509. </card>
  17510.  
  17511.  
  17512. card_39760.xml
  17513. <?xml version="1.0" encoding="utf-8" ?>
  17514. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17515. <card>
  17516.     <id>39760</id>
  17517.     <filler1>0</filler1>
  17518.     <cantDelete> <false /> </cantDelete>
  17519.     <showPict> <true /> </showPict>
  17520.     <dontSearch> <false /> </dontSearch>
  17521.     <owner>4755</owner>
  17522.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17523.     <content>
  17524.         <layer>background</layer>
  17525.         <id>4</id>
  17526.         <text><span class="style3">nother alternative in this case is to declare name to be a character pointer variable rather than an array.  Then it may be assigned the address of a constant array direct- ly:
  17527. </span><span class="style4">
  17528.     void   Person::set(void)
  17529.     {
  17530.         name = "Jack Knapp";      // no problem with TC.
  17531.     }
  17532.  
  17533. </span><span class="style3"> ‚Äî or immobile space allocated dynamically with the standard </span><span class="style4">malloc()</span><span class="style3"> function*:</span><span class="style4">
  17534.  
  17535.     void   Person::set(void)
  17536.     {
  17537.         name = malloc((sizeof char) * 80); // dynamic allocation 
  17538.         strcpy(name,"Jack Knapp");   // ok if name is allocated with malloc() 
  17539.     }
  17540.  
  17541. </span><span class="style3">Occasionally these techniques will be inconvenient or inappropriate, and the Macintosh Toolbox routines </span><span class="style4">HLock()</span><span class="style3"> and </span><span class="style4">HUnlock()</span><span class="style3"> can be used to prevent indirect objects from moving.  See the Think C manuals for further details.
  17542. </span></text>
  17543.     </content>
  17544.     <content>
  17545.         <layer>background</layer>
  17546.         <id>7</id>
  17547.         <text>161</text>
  17548.     </content>
  17549.     <content>
  17550.         <layer>background</layer>
  17551.         <id>27</id>
  17552.         <text>Dynamic memory allocation
  17553. </text>
  17554.     </content>
  17555.     <content>
  17556.         <layer>background</layer>
  17557.         <id>20</id>
  17558.         <text>Dynamic memory allocation - p219</text>
  17559.     </content>
  17560.     <content>
  17561.         <layer>background</layer>
  17562.         <id>29</id>
  17563.         <text>35106
  17564. </text>
  17565.     </content>
  17566.     <content>
  17567.         <layer>background</layer>
  17568.         <id>18</id>
  17569.         <text>p251</text>
  17570.     </content>
  17571.     <name></name>
  17572.     <script></script>
  17573. </card>
  17574.  
  17575.  
  17576. card_21830.xml
  17577. <?xml version="1.0" encoding="utf-8" ?>
  17578. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17579. <card>
  17580.     <id>21830</id>
  17581.     <filler1>0</filler1>
  17582.     <cantDelete> <false /> </cantDelete>
  17583.     <showPict> <true /> </showPict>
  17584.     <dontSearch> <false /> </dontSearch>
  17585.     <owner>4755</owner>
  17586.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17587.     <content>
  17588.         <layer>background</layer>
  17589.         <id>4</id>
  17590.         <text><span class="style3">nother interesting problem arose in Think C 4.0, when dealing with an instance variable which was itself an array of objects.  Bombs could occur when a non-constant value was used to index the array for allocation, such as when the elements were allocated in a loop:
  17591. </span><span class="style4">
  17592.     int    Room::initialize(void)
  17593.     { 
  17594.         int   i;
  17595.         for (i=0 ; i<MAX_STUDENTS ; i++)
  17596.         {   
  17597.             student_array[i] = new(Student);    // may bomb in Think C 4.0 
  17598.         }
  17599.     }
  17600. </span><span class="style3">
  17601. The problem occurred because the left-hand side of the assignment expression was evaluated first, determining the location of the ith element of the array of object references.  If the right-hand expression moved memory this address became incorrect.  </span><span class="style7">This problem was "fixed" in Think C 5.0 by evaluating the right-hand side of the expression first.</span><span class="style3">
  17602.  
  17603. </span></text>
  17604.     </content>
  17605.     <content>
  17606.         <layer>background</layer>
  17607.         <id>7</id>
  17608.         <text>162</text>
  17609.     </content>
  17610.     <content>
  17611.         <layer>background</layer>
  17612.         <id>18</id>
  17613.         <text>p251</text>
  17614.     </content>
  17615.     <name></name>
  17616.     <script></script>
  17617. </card>
  17618.  
  17619.  
  17620. card_40041.xml
  17621. <?xml version="1.0" encoding="utf-8" ?>
  17622. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17623. <card>
  17624.     <id>40041</id>
  17625.     <filler1>0</filler1>
  17626.     <cantDelete> <false /> </cantDelete>
  17627.     <showPict> <true /> </showPict>
  17628.     <dontSearch> <false /> </dontSearch>
  17629.     <owner>4755</owner>
  17630.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17631.     <content>
  17632.         <layer>background</layer>
  17633.         <id>4</id>
  17634.         <text><span class="style3">IRECT CLASSES
  17635.  
  17636. To avoid the aforementioned problems, classes may be defined using the </span><span class="style4">direct</span><span class="style3"> specifier.  In this case the implementation of object references is </span><span class="style7">not</span><span class="style3"> a handle, but is simply a pointer.  However, this does not affect usage of the references.
  17637. </span><span class="style4">
  17638.     class Person:direct
  17639.     {
  17640.         ...
  17641.     };
  17642.  
  17643. </span><span class="style3">This approach is useful when porting C++ programs to Think C.  Using direct classes is also occasionally preferable to avoid overloading the Macintosh memory manager with many small objects.
  17644. </span><span class="style4">
  17645. </span><span class="style3">The drawback, as mentioned earlier, is that the Macintosh memory management routines have less freedom in dynamically restructuring memory since objects may not be moved.
  17646.  
  17647. </span></text>
  17648.     </content>
  17649.     <content>
  17650.         <layer>background</layer>
  17651.         <id>7</id>
  17652.         <text>163</text>
  17653.     </content>
  17654.     <content>
  17655.         <layer>background</layer>
  17656.         <id>29</id>
  17657.         <text>35106</text>
  17658.     </content>
  17659.     <content>
  17660.         <layer>background</layer>
  17661.         <id>27</id>
  17662.         <text>Memory management functions</text>
  17663.     </content>
  17664.     <content>
  17665.         <layer>background</layer>
  17666.         <id>20</id>
  17667.         <text>Memory management functions - p219</text>
  17668.     </content>
  17669.     <content>
  17670.         <layer>background</layer>
  17671.         <id>18</id>
  17672.         <text>p251</text>
  17673.     </content>
  17674.     <name></name>
  17675.     <script></script>
  17676. </card>
  17677.  
  17678.  
  17679. card_9080.xml
  17680. <?xml version="1.0" encoding="utf-8" ?>
  17681. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17682. <card>
  17683.     <id>9080</id>
  17684.     <filler1>0</filler1>
  17685.     <cantDelete> <false /> </cantDelete>
  17686.     <showPict> <true /> </showPict>
  17687.     <dontSearch> <false /> </dontSearch>
  17688.     <owner>4755</owner>
  17689.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17690.     <content>
  17691.         <layer>background</layer>
  17692.         <id>6</id>
  17693.         <text>5.  Operators  </text>
  17694.     </content>
  17695.     <content>
  17696.         <layer>background</layer>
  17697.         <id>7</id>
  17698.         <text>164</text>
  17699.     </content>
  17700.     <content>
  17701.         <layer>background</layer>
  17702.         <id>4</id>
  17703.         <text><span class="style3">everal miscellaneous C </span><span class="style7">operators</span><span class="style3"> have been introduced in previous chapters.  The array subscripting operator</span><span class="style4"> []</span><span class="style3">, structure field selection operators</span><span class="style4"> . </span><span class="style3">and</span><span class="style4"> -></span><span class="style3">, "address of" and "that which is pointed to by" (indirection) operators</span><span class="style4"> & </span><span class="style3">and</span><span class="style4"> *</span><span class="style3">, and assignment operator</span><span class="style4"> = </span><span class="style3">were discussed in Chapter 2.  The function call operator</span><span class="style4"> ()</span><span class="style3"> was given in Chapter 3.  The comma operator</span><span class="style4"> , </span><span class="style3">is discussed in Chapter 6 and the </span><span class="style4">sizeof</span><span class="style3"> operator in Chapter 8.
  17704.  
  17705. The </span><span class="style4">new</span><span class="style3"> and </span><span class="style4">delete</span><span class="style3"> operators provided by Think C and C++ are discussed in Chapter 4.  Think C allows these operators to be customized*, while C++ includes the ability to customize other operators as well.  This "overloading" feature is not discussed here.
  17706.  
  17707. This chapter begins with a discussion on C expressions and introduces the arithmetic and logical operators, type conversion, and (briefly) bit manipulation.  
  17708.  
  17709. </span></text>
  17710.     </content>
  17711.     <content>
  17712.         <layer>background</layer>
  17713.         <id>29</id>
  17714.         <text>70105</text>
  17715.     </content>
  17716.     <content>
  17717.         <layer>background</layer>
  17718.         <id>27</id>
  17719.         <text>Allocators & deallocators</text>
  17720.     </content>
  17721.     <content>
  17722.         <layer>background</layer>
  17723.         <id>20</id>
  17724.         <text>Allocators & deallocators - p157</text>
  17725.     </content>
  17726.     <name></name>
  17727.     <script></script>
  17728. </card>
  17729.  
  17730.  
  17731. card_45494.xml
  17732. <?xml version="1.0" encoding="utf-8" ?>
  17733. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17734. <card>
  17735.     <id>45494</id>
  17736.     <filler1>0</filler1>
  17737.     <cantDelete> <false /> </cantDelete>
  17738.     <showPict> <true /> </showPict>
  17739.     <dontSearch> <false /> </dontSearch>
  17740.     <owner>4755</owner>
  17741.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17742.     <content>
  17743.         <layer>background</layer>
  17744.         <id>4</id>
  17745.         <text><span class="style3">XPRESSIONS & PRECEDENCE
  17746.  
  17747. C expressions occur as assignments, function arguments, and as part of other statements discussed in Chapter 6.
  17748.  
  17749. All C operators ‚Äî including the assignment</span><span class="style4"> = </span><span class="style3">and logical operators ‚Äî can be mixed freely in expressions (with appropriate type conversion).  This affords great flexibility in program style and structure, although care must be exercised to avoid excessively complex constructs which may lead to programming errors and obscure code.
  17750.  
  17751. The associativity of most operators is left to right, with the exception of the assignment operators.
  17752.  
  17753. The order of evaluation of operators within an expression is given in the following chart (adapted from Kernighan and Ritchie's*) although parentheses can be used to force the desired order of evaluation.
  17754. </span></text>
  17755.     </content>
  17756.     <content>
  17757.         <layer>background</layer>
  17758.         <id>7</id>
  17759.         <text>165</text>
  17760.     </content>
  17761.     <content>
  17762.         <layer>background</layer>
  17763.         <id>29</id>
  17764.         <text>2231</text>
  17765.     </content>
  17766.     <content>
  17767.         <layer>background</layer>
  17768.         <id>27</id>
  17769.         <text>Bibliography</text>
  17770.     </content>
  17771.     <content>
  17772.         <layer>background</layer>
  17773.         <id>20</id>
  17774.         <text>Bibliography - p259</text>
  17775.     </content>
  17776.     <name></name>
  17777.     <script></script>
  17778. </card>
  17779.  
  17780.  
  17781. card_45796.xml
  17782. <?xml version="1.0" encoding="utf-8" ?>
  17783. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17784. <card>
  17785.     <id>45796</id>
  17786.     <filler1>0</filler1>
  17787.     <cantDelete> <false /> </cantDelete>
  17788.     <showPict> <true /> </showPict>
  17789.     <dontSearch> <false /> </dontSearch>
  17790.     <owner>4755</owner>
  17791.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17792.     <part>
  17793.         <id>1</id>
  17794.         <type>field</type>
  17795.         <visible> <true /> </visible>
  17796.         <dontWrap> <false /> </dontWrap>
  17797.         <dontSearch> <false /> </dontSearch>
  17798.         <sharedText> <false /> </sharedText>
  17799.         <fixedLineHeight> <true /> </fixedLineHeight>
  17800.         <autoTab> <false /> </autoTab>
  17801.         <lockText> <true /> </lockText>
  17802.         <rect>
  17803.             <left>85</left>
  17804.             <top>100</top>
  17805.             <right>427</right>
  17806.             <bottom>287</bottom>
  17807.         </rect>
  17808.         <style>shadow</style>
  17809.         <autoSelect> <false /> </autoSelect>
  17810.         <showLines> <true /> </showLines>
  17811.         <wideMargins> <false /> </wideMargins>
  17812.         <multipleLines> <false /> </multipleLines>
  17813.         <reservedFamily> 0 </reservedFamily>
  17814.         <titleWidth>0</titleWidth>
  17815.         <icon>0</icon>
  17816.         <textAlign>left</textAlign>
  17817.         <font>Monaco</font>
  17818.         <textSize>9</textSize>
  17819.         <textStyle>plain</textStyle>
  17820.         <textHeight>12</textHeight>
  17821.         <name></name>
  17822.         <script></script>
  17823.     </part>
  17824.     <content>
  17825.         <layer>background</layer>
  17826.         <id>6</id>
  17827.         <text>
  17828. </text>
  17829.     </content>
  17830.     <content>
  17831.         <layer>card</layer>
  17832.         <id>1</id>
  17833.         <text>()    []    ->    .
  17834. !    ~    ++    --    -    (type)    *    &    sizeof
  17835. *    /    %
  17836. +    -
  17837. <<    >>
  17838. <    <=    >    >=
  17839. ==    !=
  17840. &
  17841. ^
  17842. |
  17843. &&
  17844. ||
  17845. ?:
  17846. =    +=    -=    *=    /=    %=
  17847. ,
  17848. </text>
  17849.     </content>
  17850.     <content>
  17851.         <layer>background</layer>
  17852.         <id>4</id>
  17853.         <text>Precedence of C operators (operators in the same row have the same precedence; those in lower rows have lower precedence):</text>
  17854.     </content>
  17855.     <content>
  17856.         <layer>background</layer>
  17857.         <id>7</id>
  17858.         <text>166</text>
  17859.     </content>
  17860.     <name></name>
  17861.     <script></script>
  17862. </card>
  17863.  
  17864.  
  17865. card_44454.xml
  17866. <?xml version="1.0" encoding="utf-8" ?>
  17867. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17868. <card>
  17869.     <id>44454</id>
  17870.     <filler1>0</filler1>
  17871.     <cantDelete> <false /> </cantDelete>
  17872.     <showPict> <true /> </showPict>
  17873.     <dontSearch> <false /> </dontSearch>
  17874.     <owner>4755</owner>
  17875.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17876.     <content>
  17877.         <layer>background</layer>
  17878.         <id>6</id>
  17879.         <text>5.1  Arithmetic Operators</text>
  17880.     </content>
  17881.     <content>
  17882.         <layer>background</layer>
  17883.         <id>7</id>
  17884.         <text>167</text>
  17885.     </content>
  17886.     <content>
  17887.         <layer>background</layer>
  17888.         <id>4</id>
  17889.         <text><span class="style3">s expected, the multiplication</span><span class="style4"> * </span><span class="style3">and division</span><span class="style4"> / </span><span class="style3">operators have precedence over the addition</span><span class="style4"> + </span><span class="style3">and subtraction</span><span class="style4"> - </span><span class="style3">operators.  The modulus operator</span><span class="style4"> % </span><span class="style3">produces the remainder when its integer operands divide each other.  No exponentiation operator is provided. The standard math library function </span><span class="style4">pow()</span><span class="style3"> serves this purpose.*
  17890.  
  17891. One source of occasional programming errors is that arithmetic operations involving only integer values produce an integer result.  In the following example, the float variable </span><span class="style4">f</span><span class="style3"> is initialized with the value 0 whereas </span><span class="style4">g</span><span class="style3"> is assigned .5 (recall that constants must contain a decimal point to be considered floating-point numbers).
  17892. </span><span class="style4">
  17893.     float  f = 1/2;          // assigns 0 to f 
  17894.     float  g = 1./2.;
  17895.  
  17896. </span><span class="style3">The unary (one-operand) negation operator</span><span class="style4"> - </span><span class="style3">has higher precedence than the foregoing operators, as do the unary increment</span><span class="style4"> ++ </span><span class="style3">and decrement</span><span class="style4"> -- </span><span class="style3">operators.  These last operators are a shorthand for assigning the value of a variable incremented or decremented by 1 to the same variable.  As with other assignment operators, the change to the value of the variable is considered a "side effect", since</span></text>
  17897.     </content>
  17898.     <content>
  17899.         <layer>background</layer>
  17900.         <id>29</id>
  17901.         <text>34612</text>
  17902.     </content>
  17903.     <content>
  17904.         <layer>background</layer>
  17905.         <id>27</id>
  17906.         <text>pow() function</text>
  17907.     </content>
  17908.     <content>
  17909.         <layer>background</layer>
  17910.         <id>20</id>
  17911.         <text>pow() function - p215</text>
  17912.     </content>
  17913.     <name></name>
  17914.     <script></script>
  17915. </card>
  17916.  
  17917.  
  17918. card_45919.xml
  17919. <?xml version="1.0" encoding="utf-8" ?>
  17920. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17921. <card>
  17922.     <id>45919</id>
  17923.     <filler1>0</filler1>
  17924.     <cantDelete> <false /> </cantDelete>
  17925.     <showPict> <true /> </showPict>
  17926.     <dontSearch> <false /> </dontSearch>
  17927.     <owner>4755</owner>
  17928.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17929.     <content>
  17930.         <layer>background</layer>
  17931.         <id>4</id>
  17932.         <text><span class="style3">valuating the part of the expression containing the operator yields a usable value as well.  The</span><span class="style4"> ++ </span><span class="style3">and</span><span class="style4"> -- </span><span class="style3">operators may be used in prefix form (preceding the operand) or in postfix form (following the operand) depending on whether the variable should be incremented/decremented </span><span class="style7">before</span><span class="style3"> evaluation or </span><span class="style7">after</span><span class="style3"> evaluation.  For example, the following expression increments both </span><span class="style4">a</span><span class="style3"> and </span><span class="style4">b</span><span class="style3"> yet assigns </span><span class="style4">(a+1)</span><span class="style3"> times </span><span class="style4">b</span><span class="style3"> to </span><span class="style4">c</span><span class="style3">:
  17933. </span><span class="style4">
  17934.     c = ++a * b++;
  17935.  
  17936. </span><span class="style3">C also provides shorthand operators for assigning to a variable the effect of adding, subtracting, multiplying, dividing, or taking the integer remainder of this variable with another value.  The following demonstrates the advantages in efficiency and clarity afforded by these operators:
  17937. </span><span class="style4">
  17938.     f_array[index_function(i,j,k)] = f_array[index_function(i,j,k)] + x;
  17939.  
  17940.     f_array[index_function(i,j,k)] += x;     // using shorthand operator 
  17941.  
  17942. </span><span class="style3">The first statement requires evaluation of </span><span class="style4">index_function()</span><span class="style3"> twice, and requires the </span></text>
  17943.     </content>
  17944.     <content>
  17945.         <layer>background</layer>
  17946.         <id>7</id>
  17947.         <text>168</text>
  17948.     </content>
  17949.     <name></name>
  17950.     <script></script>
  17951. </card>
  17952.  
  17953.  
  17954. card_47517.xml
  17955. <?xml version="1.0" encoding="utf-8" ?>
  17956. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17957. <card>
  17958.     <id>47517</id>
  17959.     <filler1>0</filler1>
  17960.     <cantDelete> <false /> </cantDelete>
  17961.     <showPict> <true /> </showPict>
  17962.     <dontSearch> <false /> </dontSearch>
  17963.     <owner>4755</owner>
  17964.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17965.     <content>
  17966.         <layer>background</layer>
  17967.         <id>4</id>
  17968.         <text><span class="style3">erson reading the code to ascertain that indeed this statement simply increments a single array element by </span><span class="style4">x</span><span class="style3">.</span></text>
  17969.     </content>
  17970.     <content>
  17971.         <layer>background</layer>
  17972.         <id>7</id>
  17973.         <text>169</text>
  17974.     </content>
  17975.     <name></name>
  17976.     <script></script>
  17977. </card>
  17978.  
  17979.  
  17980. card_44647.xml
  17981. <?xml version="1.0" encoding="utf-8" ?>
  17982. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  17983. <card>
  17984.     <id>44647</id>
  17985.     <filler1>0</filler1>
  17986.     <cantDelete> <false /> </cantDelete>
  17987.     <showPict> <true /> </showPict>
  17988.     <dontSearch> <false /> </dontSearch>
  17989.     <owner>4755</owner>
  17990.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  17991.     <content>
  17992.         <layer>background</layer>
  17993.         <id>6</id>
  17994.         <text>5.2  Logical Operators</text>
  17995.     </content>
  17996.     <content>
  17997.         <layer>background</layer>
  17998.         <id>4</id>
  17999.         <text><span class="style3">ogical expressions in C yield a value of 1 (true) or 0 (false).  For example:
  18000. </span><span class="style4">
  18001.     result = 5 > 6;
  18002.  
  18003. </span><span class="style3">Since the assignment operator</span><span class="style4"> = </span><span class="style3">has very low precedence, the logical expression </span><span class="style4">5>6</span><span class="style3"> is evaluated first, and the value 0 (false) is assigned to the integer variable </span><span class="style4">result</span><span class="style3">.  To distinguish it from the assignment operator, the logical operator for equality uses two equal signs:</span><span class="style4"> ==</span><span class="style3">.  </span><span class="style7">A very common programming error is to use the ssignment operator where the equality operator was intended.</span><span class="style3">  For example, the programmer expected the condition in the following </span><span class="style4">if</span><span class="style3"> statement to be true, since the value of "</span><span class="style4">a==0</span><span class="style3">" would be 1.  However, since the value of an assignment expression is the value which was assigned, the value of "</span><span class="style4">a = 0</span><span class="style3">" is 0 and the condition is false.  Note that the expression is still legal, so no compilation error is generated.
  18004. </span><span class="style4">
  18005.     int    a = 0;
  18006.     if (a = 0)        // 'a == 0' was intended 
  18007.           .
  18008.           .
  18009. </span><span class="style3">
  18010.  
  18011.  
  18012.  
  18013.  
  18014.  
  18015.  
  18016.  
  18017.  
  18018.  
  18019.  
  18020. </span></text>
  18021.     </content>
  18022.     <content>
  18023.         <layer>background</layer>
  18024.         <id>7</id>
  18025.         <text>170</text>
  18026.     </content>
  18027.     <name></name>
  18028.     <script></script>
  18029. </card>
  18030.  
  18031.  
  18032. card_46228.xml
  18033. <?xml version="1.0" encoding="utf-8" ?>
  18034. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18035. <card>
  18036.     <id>46228</id>
  18037.     <filler1>0</filler1>
  18038.     <cantDelete> <false /> </cantDelete>
  18039.     <showPict> <true /> </showPict>
  18040.     <dontSearch> <false /> </dontSearch>
  18041.     <owner>4755</owner>
  18042.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18043.     <content>
  18044.         <layer>background</layer>
  18045.         <id>4</id>
  18046.         <text><span class="style3">he "not equal to" operator in C is</span><span class="style4"> !=</span><span class="style3">, the "not" operator is</span><span class="style4"> !</span><span class="style3">, the "and" operator is </span><span class="style4">&&</span><span class="style3">, and the "or" operator is</span><span class="style4"> ||</span><span class="style3">.  The condition in the following</span><span class="style4"> if </span><span class="style3">statement is true:
  18047. </span><span class="style4">
  18048.     if (!(4==5) && 6!=7)
  18049.                 .
  18050.                 .
  18051.  
  18052. </span><span class="style3">In English, it says:  "if four equals five is </span><span class="style7">not</span><span class="style3"> true, </span><span class="style7">and</span><span class="style3"> six does not equal seven...".
  18053.  
  18054. As a shorthand for the</span><span class="style4"> if </span><span class="style3">statement*, C provides the ternary (three-operand) conditional operator</span><span class="style4"> ?:</span><span class="style3">.  The value of an expression using this operator depends upon the value of its first operand.  If the first operand is true (non-zero), then the second operand is evaluated; else, the third is evaluated and becomes the value of the expression.  The operator may be mixed freely with other operators.  For example, the following assigns the value 12 to </span><span class="style4">result</span><span class="style3">:
  18055. </span><span class="style4">
  18056.     result = ((5==6) ? 5 : 6) * 2;</span></text>
  18057.     </content>
  18058.     <content>
  18059.         <layer>background</layer>
  18060.         <id>7</id>
  18061.         <text>171</text>
  18062.     </content>
  18063.     <content>
  18064.         <layer>background</layer>
  18065.         <id>29</id>
  18066.         <text>48179</text>
  18067.     </content>
  18068.     <content>
  18069.         <layer>background</layer>
  18070.         <id>27</id>
  18071.         <text>if-else statement</text>
  18072.     </content>
  18073.     <content>
  18074.         <layer>background</layer>
  18075.         <id>20</id>
  18076.         <text>if-else statement - p180</text>
  18077.     </content>
  18078.     <name></name>
  18079.     <script></script>
  18080. </card>
  18081.  
  18082.  
  18083. card_44917.xml
  18084. <?xml version="1.0" encoding="utf-8" ?>
  18085. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18086. <card>
  18087.     <id>44917</id>
  18088.     <filler1>0</filler1>
  18089.     <cantDelete> <false /> </cantDelete>
  18090.     <showPict> <true /> </showPict>
  18091.     <dontSearch> <false /> </dontSearch>
  18092.     <owner>4755</owner>
  18093.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18094.     <content>
  18095.         <layer>background</layer>
  18096.         <id>6</id>
  18097.         <text>5.3  Type Conversion</text>
  18098.     </content>
  18099.     <content>
  18100.         <layer>background</layer>
  18101.         <id>4</id>
  18102.         <text>AUTOMATIC TYPE CONVERSION
  18103.  
  18104. C attempts to preserve the value of an expression when mixed with an expression or variable of another type.  As was seen in Chapter 2, chars are automatically converted to ints in mixed arithmetic expressions.  During arithmetic involving both ints and doubles, ints are "promoted" to double, as are floats when mixed with doubles.
  18105.  
  18106. In fact, previous to ANSI C, all expressions involving floats were converted to double.  ANSI C allows single-precision arithmetic operations when all operands are float.
  18107.  
  18108. When an assignment operator is used, the value of the right side is converted to the type of the left side where possible.  High-order bits in an int are discarded when converted to char, if necessary.  The fractional part of a float is discarded when converted to int.  A double is rounded when converting to float.
  18109.  
  18110. As discussed later in this section, values may be explicitly converted to another type 
  18111.  
  18112.  
  18113.  
  18114. </text>
  18115.     </content>
  18116.     <content>
  18117.         <layer>background</layer>
  18118.         <id>7</id>
  18119.         <text>172</text>
  18120.     </content>
  18121.     <name></name>
  18122.     <script></script>
  18123. </card>
  18124.  
  18125.  
  18126. card_47733.xml
  18127. <?xml version="1.0" encoding="utf-8" ?>
  18128. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18129. <card>
  18130.     <id>47733</id>
  18131.     <filler1>0</filler1>
  18132.     <cantDelete> <false /> </cantDelete>
  18133.     <showPict> <true /> </showPict>
  18134.     <dontSearch> <false /> </dontSearch>
  18135.     <owner>4755</owner>
  18136.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18137.     <content>
  18138.         <layer>background</layer>
  18139.         <id>4</id>
  18140.         <text>by the programmer, to supercede the automatic type conversion rules.  In fact, explicit type conversion is frequently used even when the automatic rules have the same effect, in order to clarify the evaluation of mixed expressions.
  18141. </text>
  18142.     </content>
  18143.     <content>
  18144.         <layer>background</layer>
  18145.         <id>7</id>
  18146.         <text>173</text>
  18147.     </content>
  18148.     <name></name>
  18149.     <script></script>
  18150. </card>
  18151.  
  18152.  
  18153. card_46937.xml
  18154. <?xml version="1.0" encoding="utf-8" ?>
  18155. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18156. <card>
  18157.     <id>46937</id>
  18158.     <filler1>0</filler1>
  18159.     <cantDelete> <false /> </cantDelete>
  18160.     <showPict> <true /> </showPict>
  18161.     <dontSearch> <false /> </dontSearch>
  18162.     <owner>4755</owner>
  18163.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18164.     <content>
  18165.         <layer>background</layer>
  18166.         <id>4</id>
  18167.         <text><span class="style3">UNCTION PROTOTYPES FOR TYPE CONVERSION
  18168.  
  18169. Traditionally, C's absence of run-time type checking contributed to its efficiency and flexibility but could also be the source of much programming frustration.  When a value was passed as a function argument, its type was not converted automatically to the type expected by the function.  Thus a call to the</span><span class="style4"> sqrt() </span><span class="style3">math library function of the form:
  18170. </span><span class="style4">
  18171.     result = sqrt(10);      // bad result using pre-ANSI C 
  18172.  
  18173. </span><span class="style3">returned an incorrect result since an int argument was passed to a function expecting a double.
  18174.  
  18175. With the advent of function prototypes* in ANSI C (and TC and C++), automatic type conversion was extended to such cases.  That is, by stating the types of the arguments expected by a function before that function is called, a function prototype gives the compiler enough information to provide the needed type conversion.
  18176. </span></text>
  18177.     </content>
  18178.     <content>
  18179.         <layer>background</layer>
  18180.         <id>29</id>
  18181.         <text>12248</text>
  18182.     </content>
  18183.     <content>
  18184.         <layer>background</layer>
  18185.         <id>27</id>
  18186.         <text>Function prototypes</text>
  18187.     </content>
  18188.     <content>
  18189.         <layer>background</layer>
  18190.         <id>20</id>
  18191.         <text>Function prototypes - p94</text>
  18192.     </content>
  18193.     <content>
  18194.         <layer>background</layer>
  18195.         <id>7</id>
  18196.         <text>174</text>
  18197.     </content>
  18198.     <name></name>
  18199.     <script></script>
  18200. </card>
  18201.  
  18202.  
  18203. card_47191.xml
  18204. <?xml version="1.0" encoding="utf-8" ?>
  18205. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18206. <card>
  18207.     <id>47191</id>
  18208.     <filler1>0</filler1>
  18209.     <cantDelete> <false /> </cantDelete>
  18210.     <showPict> <true /> </showPict>
  18211.     <dontSearch> <false /> </dontSearch>
  18212.     <owner>4755</owner>
  18213.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18214.     <content>
  18215.         <layer>background</layer>
  18216.         <id>4</id>
  18217.         <text><span class="style3">ASTS
  18218. </span><span class="style4">
  18219. </span><span class="style3">Explicit type conversion is performed using the </span><span class="style7">cast</span><span class="style3"> operator.  A value is "cast" to another type by prefixing it with the desired type enclosed in parentheses.  For example, to ensure that floating-point rather than integer arithmetic is used, it may be desirable to cast an integer variable to a float in an arithmetic expression.  In this case,</span><span class="style4"> f </span><span class="style3">is assigned the value 0 while</span><span class="style4"> g </span><span class="style3">is assigned 0.5:
  18220. </span><span class="style4">
  18221.     int    a = 1,
  18222.            b = 2;
  18223.     float  f,g;
  18224.     f = a / b;
  18225.     g = (float) a / b;
  18226.  
  18227. </span><span class="style3">The cast operator has higher precedence than arithmetic operators, so the value of</span><span class="style4"> a</span><span class="style3"> is converted to a float before the division takes place.
  18228. </span><span class="style4">
  18229. </span><span class="style3">In TC and C++ casts are often used to inform the compiler of the class of an object reference.*</span></text>
  18230.     </content>
  18231.     <content>
  18232.         <layer>background</layer>
  18233.         <id>7</id>
  18234.         <text>175</text>
  18235.     </content>
  18236.     <content>
  18237.         <layer>background</layer>
  18238.         <id>29</id>
  18239.         <text>69198</text>
  18240.     </content>
  18241.     <content>
  18242.         <layer>background</layer>
  18243.         <id>27</id>
  18244.         <text>Casting object references</text>
  18245.     </content>
  18246.     <content>
  18247.         <layer>background</layer>
  18248.         <id>20</id>
  18249.         <text>Casting object references - p131</text>
  18250.     </content>
  18251.     <name></name>
  18252.     <script></script>
  18253. </card>
  18254.  
  18255.  
  18256. card_45309.xml
  18257. <?xml version="1.0" encoding="utf-8" ?>
  18258. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18259. <card>
  18260.     <id>45309</id>
  18261.     <filler1>0</filler1>
  18262.     <cantDelete> <false /> </cantDelete>
  18263.     <showPict> <true /> </showPict>
  18264.     <dontSearch> <false /> </dontSearch>
  18265.     <owner>4755</owner>
  18266.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18267.     <content>
  18268.         <layer>background</layer>
  18269.         <id>6</id>
  18270.         <text>5.4  Bit Manipulation</text>
  18271.     </content>
  18272.     <content>
  18273.         <layer>background</layer>
  18274.         <id>4</id>
  18275.         <text><span class="style3">o fulfill its original role as a "low-level" (but extensible) language suited for writing operating systems, C provides numerous operators for bit manipulation.  Operands for these operators must be integral types.  For this purpose, integral values may be assigned using octal constants, which contain a leading zero:
  18276. </span><span class="style4">
  18277.     int    n = 077;     // decimal value 63 
  18278.  
  18279. </span><span class="style3">Briefly, C's bit manipulation operators are:  bitwise negation</span><span class="style4"> ~</span><span class="style3">; left shift</span><span class="style4"> << </span><span class="style3">and right shift</span><span class="style4"> >></span><span class="style3">; bitwise "and"</span><span class="style4"> &</span><span class="style3">, "or"</span><span class="style4"> |</span><span class="style3">, and "xor"</span><span class="style4"> ^</span><span class="style3">; shorthand shift-assignment</span><span class="style4"> <<= </span><span class="style3">and </span><span class="style4">>>=</span><span class="style3">; shorthand "and"-assignment</span><span class="style4"> &=</span><span class="style3">, "or"-assignment</span><span class="style4"> |=</span><span class="style3">, and "xor"-assignment</span><span class="style4"> ^=</span><span class="style3">. 
  18280.  
  18281. </span></text>
  18282.     </content>
  18283.     <content>
  18284.         <layer>background</layer>
  18285.         <id>7</id>
  18286.         <text>176</text>
  18287.     </content>
  18288.     <name></name>
  18289.     <script></script>
  18290. </card>
  18291.  
  18292.  
  18293. card_21180.xml
  18294. <?xml version="1.0" encoding="utf-8" ?>
  18295. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18296. <card>
  18297.     <id>21180</id>
  18298.     <filler1>0</filler1>
  18299.     <cantDelete> <false /> </cantDelete>
  18300.     <showPict> <true /> </showPict>
  18301.     <dontSearch> <false /> </dontSearch>
  18302.     <owner>4755</owner>
  18303.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18304.     <content>
  18305.         <layer>background</layer>
  18306.         <id>6</id>
  18307.         <text>6.  Statements</text>
  18308.     </content>
  18309.     <content>
  18310.         <layer>background</layer>
  18311.         <id>7</id>
  18312.         <text>177</text>
  18313.     </content>
  18314.     <content>
  18315.         <layer>background</layer>
  18316.         <id>4</id>
  18317.         <text><span class="style3">he simplest C statement is the </span><span class="style7">null statement</span><span class="style3">, a lone semicolon.  This is occasionally used when a loop body does not require any expressions, as shown later in this chapter.  An </span><span class="style7">expression statement</span><span class="style3"> is an expression followed by a semicolon:
  18318. </span><span class="style4">
  18319.     2 + 2;        // useless statement 
  18320.  
  18321. </span><span class="style3">Notice that the value of the expression is ignored.  A more useful such statement is one whose expression has a "side effect" like assigning a value or evaluating a function!
  18322. </span><span class="style4">
  18323.     int   a;         // declaration 
  18324.     a = 2 + 2;
  18325.     printf("result: %d\n",a);
  18326.  
  18327. </span><span class="style3">This chapter begins with a discussion on grouping expression statements and goes on to discuss C's control flow statements for conditional execution and looping.  The </span><span class="style4">return</span><span class="style3"> statement to terminate a function was already discussed in Chapter 3.
  18328. </span></text>
  18329.     </content>
  18330.     <name></name>
  18331.     <script></script>
  18332. </card>
  18333.  
  18334.  
  18335. card_49867.xml
  18336. <?xml version="1.0" encoding="utf-8" ?>
  18337. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18338. <card>
  18339.     <id>49867</id>
  18340.     <filler1>0</filler1>
  18341.     <cantDelete> <false /> </cantDelete>
  18342.     <showPict> <true /> </showPict>
  18343.     <dontSearch> <false /> </dontSearch>
  18344.     <owner>4755</owner>
  18345.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18346.     <content>
  18347.         <layer>background</layer>
  18348.         <id>6</id>
  18349.         <text>
  18350. </text>
  18351.     </content>
  18352.     <content>
  18353.         <layer>background</layer>
  18354.         <id>4</id>
  18355.         <text><span class="style3">OMPOUND STATEMENTS
  18356.  
  18357. A group of statements enclosed in curly</span><span class="style4"> {} </span><span class="style3">braces is a compound statement or "block".  (The closing brace should not generally be followed by a semicolon.  If it is, then the semicolon is considered a separate null statement.)  Compound statements are used for function bodies, user-defined data types, and anywhere the language syntax requires a statement as will be seen in this chapter.
  18358.  
  18359. In particular, a block may be </span><span class="style7">nested</span><span class="style3"> within another block, and may contain declarations of variables local to the inner block.  This construct is rarely used, since creating a separate function to accomplish the processing of the inner block usually improves code readability and modularity.
  18360.  
  18361.  
  18362. </span></text>
  18363.     </content>
  18364.     <content>
  18365.         <layer>background</layer>
  18366.         <id>7</id>
  18367.         <text>178</text>
  18368.     </content>
  18369.     <content>
  18370.         <layer>background</layer>
  18371.         <id>17</id>
  18372.         <text>p215</text>
  18373.     </content>
  18374.     <name></name>
  18375.     <script></script>
  18376. </card>
  18377.  
  18378.  
  18379. card_50052.xml
  18380. <?xml version="1.0" encoding="utf-8" ?>
  18381. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18382. <card>
  18383.     <id>50052</id>
  18384.     <filler1>0</filler1>
  18385.     <cantDelete> <false /> </cantDelete>
  18386.     <showPict> <true /> </showPict>
  18387.     <dontSearch> <false /> </dontSearch>
  18388.     <owner>4755</owner>
  18389.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18390.     <content>
  18391.         <layer>background</layer>
  18392.         <id>4</id>
  18393.         <text><span class="style3">OMMA OPERATOR
  18394.  
  18395. A sequence of expression statements may be rewritten as a single statement, where the individual expressions are separated by the comma operator.  Evaluation is from left to right, and the value of the statement (ignored in the following example) is that of the rightmost expression.
  18396. </span><span class="style4">
  18397.     temp = i , i = j , j = temp;          // swap i and j values 
  18398.  
  18399. </span><span class="style3">As with nested blocks this construct should be used sparingly and with care to avoid obscuring program structure.  The comma operator most often finds use in conjunction with the </span><span class="style4">while</span><span class="style3"> and </span><span class="style4">for</span><span class="style3"> loops discussed later in this chapter.
  18400. </span></text>
  18401.     </content>
  18402.     <content>
  18403.         <layer>background</layer>
  18404.         <id>7</id>
  18405.         <text>179</text>
  18406.     </content>
  18407.     <name></name>
  18408.     <script></script>
  18409. </card>
  18410.  
  18411.  
  18412. card_48179.xml
  18413. <?xml version="1.0" encoding="utf-8" ?>
  18414. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18415. <card>
  18416.     <id>48179</id>
  18417.     <filler1>0</filler1>
  18418.     <cantDelete> <false /> </cantDelete>
  18419.     <showPict> <true /> </showPict>
  18420.     <dontSearch> <false /> </dontSearch>
  18421.     <owner>4755</owner>
  18422.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18423.     <content>
  18424.         <layer>background</layer>
  18425.         <id>6</id>
  18426.         <text>6.1  if-else</text>
  18427.     </content>
  18428.     <content>
  18429.         <layer>background</layer>
  18430.         <id>4</id>
  18431.         <text><span class="style3">tatements are executed conditionally using C's</span><span class="style4"> if </span><span class="style3">statement.  Its syntax is simply:
  18432. </span><span class="style4">
  18433.     if (expression)
  18434.         statement1
  18435.     else
  18436.         statement2
  18437.  
  18438. </span><span class="style3">where the </span><span class="style4">else</span><span class="style3"> clause is optional.  If the expression is non-zero (true) then </span><span class="style4">statement1</span><span class="style3"> is executed, else </span><span class="style4">statement2</span><span class="style3"> (if present) is executed.  The statements may be simple expression statements or compound statements.  For clarity it is important to indent the statements (typically one tab stop or 4 characters).
  18439.  
  18440. Since C is permissive about the use of "white space" (spaces, tabs, new-line characters), there are several popular placements for the opening and closing braces of compound statements.  Some programmers place the opening brace at the end of the line containing the </span><span class="style4">if</span><span class="style3"> and </span><span class="style4">else</span><span class="style3"> statements, while others prefer to indent both the opening and closing braces by the same amount as in the example below.</span></text>
  18441.     </content>
  18442.     <content>
  18443.         <layer>background</layer>
  18444.         <id>7</id>
  18445.         <text>180</text>
  18446.     </content>
  18447.     <name></name>
  18448.     <script></script>
  18449. </card>
  18450.  
  18451.  
  18452. card_50308.xml
  18453. <?xml version="1.0" encoding="utf-8" ?>
  18454. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18455. <card>
  18456.     <id>50308</id>
  18457.     <filler1>0</filler1>
  18458.     <cantDelete> <false /> </cantDelete>
  18459.     <showPict> <true /> </showPict>
  18460.     <dontSearch> <false /> </dontSearch>
  18461.     <owner>4755</owner>
  18462.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18463.     <content>
  18464.         <layer>background</layer>
  18465.         <id>4</id>
  18466.         <text><span class="style3">hen </span><span class="style4">if</span><span class="style3"> statements are nested the </span><span class="style4">else</span><span class="style3"> clause is by default associated with the closest </span><span class="style4">if</span><span class="style3"> statement.  Braces can be used to force a different association:
  18467. </span><span class="style4">
  18468.     if (i < 10)
  18469.     {
  18470.         if (j == i)
  18471.             done = 1;
  18472.     }
  18473.     else
  18474.         done = 1;
  18475.  
  18476.  
  18477.  
  18478.  
  18479. </span></text>
  18480.     </content>
  18481.     <content>
  18482.         <layer>background</layer>
  18483.         <id>7</id>
  18484.         <text>181</text>
  18485.     </content>
  18486.     <name></name>
  18487.     <script></script>
  18488. </card>
  18489.  
  18490.  
  18491. card_50447.xml
  18492. <?xml version="1.0" encoding="utf-8" ?>
  18493. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18494. <card>
  18495.     <id>50447</id>
  18496.     <filler1>0</filler1>
  18497.     <cantDelete> <false /> </cantDelete>
  18498.     <showPict> <true /> </showPict>
  18499.     <dontSearch> <false /> </dontSearch>
  18500.     <owner>4755</owner>
  18501.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18502.     <content>
  18503.         <layer>background</layer>
  18504.         <id>4</id>
  18505.         <text><span class="style3">IMULATING "ELSE IF"
  18506.  
  18507. The "else if" statement available in other languages is easily simulated using nested </span><span class="style4">if</span><span class="style3"> statements and the appropriate use of white space:
  18508. </span><span class="style4">
  18509.     if (i == 0)
  18510.         result = 'a';
  18511.     else if (i == 1 || i == 2)
  18512.         result = 'b';
  18513.     else if (i == 3)
  18514.         result = 'c';
  18515.     else
  18516.         result = 'd';
  18517.  
  18518. </span><span class="style3">An alternative which is often appropriate is the </span><span class="style4">switch</span><span class="style3"> statement discussed in the next section.</span></text>
  18519.     </content>
  18520.     <content>
  18521.         <layer>background</layer>
  18522.         <id>7</id>
  18523.         <text>182</text>
  18524.     </content>
  18525.     <name></name>
  18526.     <script></script>
  18527. </card>
  18528.  
  18529.  
  18530. card_48576.xml
  18531. <?xml version="1.0" encoding="utf-8" ?>
  18532. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18533. <card>
  18534.     <id>48576</id>
  18535.     <filler1>0</filler1>
  18536.     <cantDelete> <false /> </cantDelete>
  18537.     <showPict> <true /> </showPict>
  18538.     <dontSearch> <false /> </dontSearch>
  18539.     <owner>4755</owner>
  18540.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18541.     <content>
  18542.         <layer>background</layer>
  18543.         <id>6</id>
  18544.         <text>6.2  switch</text>
  18545.     </content>
  18546.     <content>
  18547.         <layer>background</layer>
  18548.         <id>4</id>
  18549.         <text><span class="style3">he </span><span class="style4">switch</span><span class="style3"> statement accomplishes a multiway decision based on comparison of an expression with several alternative constant values.  The statements following each </span><span class="style4">case</span><span class="style3"> label are executed when the value of the tested expression matches the associated constant.  The </span><span class="style4">default</span><span class="style3"> label indicates the processing if no match is found.
  18550. </span><span class="style4">
  18551.     switch (i)
  18552.     {
  18553.         case  0:  result = 'a';
  18554.                   break;
  18555.  
  18556.         case 1:                    // "fall through" to processing for case 2 
  18557.         case 2:   result = 'b';
  18558.                   break;
  18559.  
  18560.         case 3:   result = 'c';
  18561.                   break;
  18562.  
  18563.         default:  result = 'd';
  18564.                   break;
  18565.     }
  18566. </span><span class="style3">
  18567. </span></text>
  18568.     </content>
  18569.     <content>
  18570.         <layer>background</layer>
  18571.         <id>7</id>
  18572.         <text>183</text>
  18573.     </content>
  18574.     <name></name>
  18575.     <script></script>
  18576. </card>
  18577.  
  18578.  
  18579. card_50849.xml
  18580. <?xml version="1.0" encoding="utf-8" ?>
  18581. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18582. <card>
  18583.     <id>50849</id>
  18584.     <filler1>0</filler1>
  18585.     <cantDelete> <false /> </cantDelete>
  18586.     <showPict> <true /> </showPict>
  18587.     <dontSearch> <false /> </dontSearch>
  18588.     <owner>4755</owner>
  18589.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18590.     <content>
  18591.         <layer>background</layer>
  18592.         <id>4</id>
  18593.         <text><span class="style3"> </span><span class="style4">break</span><span class="style3"> statement is used to cause an immediate exit from the </span><span class="style4">switch</span><span class="style3"> body.  Without it execution will continue with the statements following the remaining cases.  The example above has the same effect as the "else if" example from the previous section, and demonstrates judicious use of </span><span class="style4">break</span><span class="style3"> statements.
  18594. </span></text>
  18595.     </content>
  18596.     <content>
  18597.         <layer>background</layer>
  18598.         <id>7</id>
  18599.         <text>184</text>
  18600.     </content>
  18601.     <name></name>
  18602.     <script></script>
  18603. </card>
  18604.  
  18605.  
  18606. card_48901.xml
  18607. <?xml version="1.0" encoding="utf-8" ?>
  18608. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18609. <card>
  18610.     <id>48901</id>
  18611.     <filler1>0</filler1>
  18612.     <cantDelete> <false /> </cantDelete>
  18613.     <showPict> <true /> </showPict>
  18614.     <dontSearch> <false /> </dontSearch>
  18615.     <owner>4755</owner>
  18616.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18617.     <content>
  18618.         <layer>background</layer>
  18619.         <id>6</id>
  18620.         <text>6.3  while/do-while</text>
  18621.     </content>
  18622.     <content>
  18623.         <layer>background</layer>
  18624.         <id>4</id>
  18625.         <text><span class="style3">he </span><span class="style4">while</span><span class="style3"> statement implements a loop whose statement (or compound statement) is repeated until the conditional expression evaluates to 0 (false):
  18626. </span><span class="style4">
  18627.     while (expression)
  18628.         statement
  18629.  
  18630. </span><span class="style3">In the following example the null statement is used, since the side effect of evaluating the expression implements all the desired processing:
  18631. </span><span class="style4">
  18632.     while (!mouse_button_is_down())
  18633.         ;
  18634.  
  18635. </span><span class="style3">An interesting application of the comma operator mentioned earlier in this chapter is to evaluate a sequence of expressions in place of the usual condition.  The expressions are evaluated left to right, and the loop continues until the rightmost expression is false.  In the following example the side effect of the leftmost expression is assigning a value to the character variable </span><span class="style4">c</span><span class="style3">.  (The standard library function </span><span class="style4">getchar()</span><span class="style3"> returns the next character from the standard input device.)
  18636. </span></text>
  18637.     </content>
  18638.     <content>
  18639.         <layer>background</layer>
  18640.         <id>7</id>
  18641.         <text>185</text>
  18642.     </content>
  18643.     <content>
  18644.         <layer>background</layer>
  18645.         <id>17</id>
  18646.         <text>p223</text>
  18647.     </content>
  18648.     <name></name>
  18649.     <script></script>
  18650. </card>
  18651.  
  18652.  
  18653. card_51117.xml
  18654. <?xml version="1.0" encoding="utf-8" ?>
  18655. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18656. <card>
  18657.     <id>51117</id>
  18658.     <filler1>0</filler1>
  18659.     <cantDelete> <false /> </cantDelete>
  18660.     <showPict> <true /> </showPict>
  18661.     <dontSearch> <false /> </dontSearch>
  18662.     <owner>4755</owner>
  18663.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18664.     <content>
  18665.         <layer>background</layer>
  18666.         <id>4</id>
  18667.         <text><span class="style4">   while (c = getchar() , c != 'x')
  18668.         process_input(c);
  18669.  
  18670. </span><span class="style3">The alternative</span><span class="style4"> do-while </span><span class="style3">statement evaluates the expression after having executed the statement once:
  18671. </span><span class="style4">
  18672.     do
  18673.         statement
  18674.         while (expression);
  18675.  
  18676. </span><span class="style3">(Note the trailing semicolon.)  Though used less frequently than</span><span class="style4"> while </span><span class="style3">or</span><span class="style4"> for </span><span class="style3">loops, there are occasional situations where</span><span class="style4"> do-while </span><span class="style3">affords simplified code.
  18677. </span></text>
  18678.     </content>
  18679.     <content>
  18680.         <layer>background</layer>
  18681.         <id>7</id>
  18682.         <text>186</text>
  18683.     </content>
  18684.     <name></name>
  18685.     <script></script>
  18686. </card>
  18687.  
  18688.  
  18689. card_51294.xml
  18690. <?xml version="1.0" encoding="utf-8" ?>
  18691. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18692. <card>
  18693.     <id>51294</id>
  18694.     <filler1>0</filler1>
  18695.     <cantDelete> <false /> </cantDelete>
  18696.     <showPict> <true /> </showPict>
  18697.     <dontSearch> <false /> </dontSearch>
  18698.     <owner>4755</owner>
  18699.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18700.     <content>
  18701.         <layer>background</layer>
  18702.         <id>4</id>
  18703.         <text><span class="style3">REAK AND CONTINUE
  18704.  
  18705. The </span><span class="style4">break</span><span class="style3"> statement may be used within the compound statement representing the loop body, to cause immediate exit from the loop.  It is usually used in conjunction with an</span><span class="style4"> if-else </span><span class="style3">statement to conditionally exit the loop.  It should be used with care, since program clarity may be compromised when the control of the loop is no longer localized in the main loop condition expression.  Consider the following example:
  18706. </span><span class="style4">
  18707.     while (i < 10)
  18708.     {
  18709.         if (position[i]  > 1000)
  18710.             break;
  18711.         printf("Position is: %d\n",position[i++]);  // increment operator '++' 
  18712.     }
  18713.  
  18714. </span><span class="style3">Instead, it may be preferable to include the break condition into the main loop condition:
  18715. </span></text>
  18716.     </content>
  18717.     <content>
  18718.         <layer>background</layer>
  18719.         <id>7</id>
  18720.         <text>187</text>
  18721.     </content>
  18722.     <name></name>
  18723.     <script></script>
  18724. </card>
  18725.  
  18726.  
  18727. card_51507.xml
  18728. <?xml version="1.0" encoding="utf-8" ?>
  18729. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18730. <card>
  18731.     <id>51507</id>
  18732.     <filler1>0</filler1>
  18733.     <cantDelete> <false /> </cantDelete>
  18734.     <showPict> <true /> </showPict>
  18735.     <dontSearch> <false /> </dontSearch>
  18736.     <owner>4755</owner>
  18737.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18738.     <content>
  18739.         <layer>background</layer>
  18740.         <id>4</id>
  18741.         <text><span class="style4">   while (i < 10 && position[i] <= 1000)
  18742.         printf("Position is: %d\n",position[i++]);
  18743.  
  18744. </span><span class="style3">Here is another alternative to </span><span class="style4">break</span><span class="style3"> which improves code clarity when an unusual condition may arise during the loop:
  18745. </span><span class="style4">
  18746.     too_big = 0;
  18747.     while (i < 10 && !too_big)
  18748.     {
  18749.         if (position[i] <= 1000)
  18750.             printf("Position is: %d\n",position[i++]);
  18751.         else
  18752.             too_big = 1;
  18753.     }
  18754.  
  18755. </span><span class="style3">The </span><span class="style4">continue</span><span class="style3"> statement is syntactically similar to </span><span class="style4">break</span><span class="style3"> but instead causes the next iteration of the loop to commence immediately.  Again, in many cases code clarity can be improved by instead using appropriate conditional expressions.</span></text>
  18756.     </content>
  18757.     <content>
  18758.         <layer>background</layer>
  18759.         <id>7</id>
  18760.         <text>188</text>
  18761.     </content>
  18762.     <name></name>
  18763.     <script></script>
  18764. </card>
  18765.  
  18766.  
  18767. card_49349.xml
  18768. <?xml version="1.0" encoding="utf-8" ?>
  18769. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18770. <card>
  18771.     <id>49349</id>
  18772.     <filler1>0</filler1>
  18773.     <cantDelete> <false /> </cantDelete>
  18774.     <showPict> <true /> </showPict>
  18775.     <dontSearch> <false /> </dontSearch>
  18776.     <owner>4755</owner>
  18777.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18778.     <content>
  18779.         <layer>background</layer>
  18780.         <id>6</id>
  18781.         <text>6.4  for</text>
  18782.     </content>
  18783.     <content>
  18784.         <layer>background</layer>
  18785.         <id>4</id>
  18786.         <text><span class="style3">he </span><span class="style4">for</span><span class="style3"> loop is highly flexible.  Its syntax is:
  18787. </span><span class="style4">
  18788.     for (expression1 ; expression2 ; expression3)
  18789.         statement
  18790.  
  18791. expression1</span><span class="style3"> is evaluated once upon entry to the loop, the statement is executed if </span><span class="style4">expression2</span><span class="style3"> evaluates to nonzero (true), and </span><span class="style4">expression3</span><span class="style3"> is evaluated at the end of each iteration of the loop.  Most commonly, </span><span class="style4">expression1</span><span class="style3"> is used as the loop initialization, </span><span class="style4">expression2</span><span class="style3"> as the loop condition, and </span><span class="style4">expression3</span><span class="style3"> to increment a loop counter.  For example:
  18792. </span><span class="style4">
  18793.     for (i=0 ; i<10 ; i++)
  18794.         process_things(i);
  18795.  
  18796. </span><span class="style3">The comma operator is useful to implement multiple counters:
  18797. </span><span class="style4">
  18798.     for (i=0,j=10 ; i<10 ; i++,j--)
  18799.         process_things(i,j);
  18800. </span></text>
  18801.     </content>
  18802.     <content>
  18803.         <layer>background</layer>
  18804.         <id>7</id>
  18805.         <text>189</text>
  18806.     </content>
  18807.     <name></name>
  18808.     <script></script>
  18809. </card>
  18810.  
  18811.  
  18812. card_49620.xml
  18813. <?xml version="1.0" encoding="utf-8" ?>
  18814. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18815. <card>
  18816.     <id>49620</id>
  18817.     <filler1>0</filler1>
  18818.     <cantDelete> <false /> </cantDelete>
  18819.     <showPict> <true /> </showPict>
  18820.     <dontSearch> <false /> </dontSearch>
  18821.     <owner>4755</owner>
  18822.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18823.     <content>
  18824.         <layer>background</layer>
  18825.         <id>6</id>
  18826.         <text>6.5  goto</text>
  18827.     </content>
  18828.     <content>
  18829.         <layer>background</layer>
  18830.         <id>4</id>
  18831.         <text><span class="style3">he </span><span class="style4">goto</span><span class="style3"> statement allows unconditional transfer to a labeled statement.  The labelled statement must occur in the same function body (actually the same statement block).  For example:
  18832. </span><span class="style4">
  18833.                      .
  18834.                      .
  18835.     goto  begin_output;
  18836.                      .
  18837.                      .
  18838.     begin_output:                          // label 
  18839.         printf("Here's the output:\n");
  18840.                      .
  18841.                      .
  18842.  
  18843. goto</span><span class="style3"> statements and labels are almost never used since they tend to obscure program structure making debugging and maintenance difficult.  Code using </span><span class="style4">goto</span><span class="style3"> can always be rewritten using structured programming constructs like</span><span class="style4"> if-else</span><span class="style3"> and </span><span class="style4">while</span><span class="style3">.</span></text>
  18844.     </content>
  18845.     <content>
  18846.         <layer>background</layer>
  18847.         <id>7</id>
  18848.         <text>190</text>
  18849.     </content>
  18850.     <content>
  18851.         <layer>background</layer>
  18852.         <id>17</id>
  18853.         <text>p62</text>
  18854.     </content>
  18855.     <name></name>
  18856.     <script></script>
  18857. </card>
  18858.  
  18859.  
  18860. card_21485.xml
  18861. <?xml version="1.0" encoding="utf-8" ?>
  18862. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18863. <card>
  18864.     <id>21485</id>
  18865.     <filler1>0</filler1>
  18866.     <cantDelete> <false /> </cantDelete>
  18867.     <showPict> <true /> </showPict>
  18868.     <dontSearch> <false /> </dontSearch>
  18869.     <owner>4755</owner>
  18870.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18871.     <content>
  18872.         <layer>background</layer>
  18873.         <id>6</id>
  18874.         <text>7.  Preprocessor Directives</text>
  18875.     </content>
  18876.     <content>
  18877.         <layer>background</layer>
  18878.         <id>7</id>
  18879.         <text>191</text>
  18880.     </content>
  18881.     <content>
  18882.         <layer>background</layer>
  18883.         <id>4</id>
  18884.         <text><span class="style3">he C </span><span class="style7">preprocessor</span><span class="style3"> performs various text-manipulation functions on source files as a first step in the compilation process.  This chapter describes how to use the preprocessor to accomplish text substitution with and without parameters, file inclusion, and conditional compilation of selected portions of the source file.
  18885.  
  18886. Think C provides a "Preprocess" option to allow the programmer to see the effects of preprocessor directives.
  18887.  
  18888.  
  18889.  
  18890. </span></text>
  18891.     </content>
  18892.     <content>
  18893.         <layer>background</layer>
  18894.         <id>17</id>
  18895.         <text>p62</text>
  18896.     </content>
  18897.     <name></name>
  18898.     <script></script>
  18899. </card>
  18900.  
  18901.  
  18902. card_51878.xml
  18903. <?xml version="1.0" encoding="utf-8" ?>
  18904. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18905. <card>
  18906.     <id>51878</id>
  18907.     <filler1>0</filler1>
  18908.     <cantDelete> <false /> </cantDelete>
  18909.     <showPict> <true /> </showPict>
  18910.     <dontSearch> <false /> </dontSearch>
  18911.     <owner>4755</owner>
  18912.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18913.     <content>
  18914.         <layer>background</layer>
  18915.         <id>6</id>
  18916.         <text>7.1  Text Substitution</text>
  18917.     </content>
  18918.     <content>
  18919.         <layer>background</layer>
  18920.         <id>4</id>
  18921.         <text><span class="style3">reprocessor directives are identified by beginning with the</span><span class="style4"> # </span><span class="style3">symbol, and are generally not indented beyond the first column.  A trailing semicolon is </span><span class="style7">not</span><span class="style3"> used.
  18922.  
  18923. </span><span class="style7">Text substitution</span><span class="style3">, or macro substitution, is performed using the</span><span class="style4"> #define </span><span class="style3">directive in the following syntax, usually located at the beginning of the source file:
  18924. </span><span class="style4">
  18925.     # define   NAME   replacement text        // no trailing semicolon! 
  18926.  
  18927. </span><span class="style3">Before compilation the preprocessor will replace all occurrences of </span><span class="style4">NAME</span><span class="style3"> in the source file with the replacement text.  The name to be replaced follows the same rules as for C variable and function identifiers.  By convention this is nearly always capitalized, to avoid confusion with other variable and function identifiers.  There are very few grammatical restrictions on the replacement text.
  18928.  
  18929. One of the most common uses of macro substitution is naming constants, as demonstrated below.  Note, however, that with the advent of the </span><span class="style4">const</span><span class="style3"> qualifier in ANSI C, there is an alternative way to identify symbolic constants.*
  18930.  
  18931.  
  18932.  
  18933.  
  18934.  
  18935.  
  18936.  
  18937.  
  18938.  
  18939.  
  18940.  
  18941. </span></text>
  18942.     </content>
  18943.     <content>
  18944.         <layer>background</layer>
  18945.         <id>7</id>
  18946.         <text>192</text>
  18947.     </content>
  18948.     <content>
  18949.         <layer>background</layer>
  18950.         <id>29</id>
  18951.         <text>70575</text>
  18952.     </content>
  18953.     <content>
  18954.         <layer>background</layer>
  18955.         <id>27</id>
  18956.         <text>const qualifier</text>
  18957.     </content>
  18958.     <content>
  18959.         <layer>background</layer>
  18960.         <id>20</id>
  18961.         <text>const qualifier - p62</text>
  18962.     </content>
  18963.     <content>
  18964.         <layer>background</layer>
  18965.         <id>18</id>
  18966.         <text>p66</text>
  18967.     </content>
  18968.     <name></name>
  18969.     <script></script>
  18970. </card>
  18971.  
  18972.  
  18973. card_52640.xml
  18974. <?xml version="1.0" encoding="utf-8" ?>
  18975. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  18976. <card>
  18977.     <id>52640</id>
  18978.     <filler1>0</filler1>
  18979.     <cantDelete> <false /> </cantDelete>
  18980.     <showPict> <true /> </showPict>
  18981.     <dontSearch> <false /> </dontSearch>
  18982.     <owner>4755</owner>
  18983.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  18984.     <content>
  18985.         <layer>background</layer>
  18986.         <id>4</id>
  18987.         <text><span class="style4">   # define   TRUE      1
  18988.     # define   FALSE     0
  18989.  
  18990. </span><span class="style3">The programmer may then use the names </span><span class="style4">TRUE</span><span class="style3"> and </span><span class="style4">FALSE</span><span class="style3"> in his/her source file, confident that these will be replaced with the constants 1 and 0 upon compilation:
  18991. </span><span class="style4">
  18992.     done = FALSE;
  18993.     while (!done)
  18994.     {
  18995.         if ((c = getchar()) == 'x')
  18996.             done = TRUE;
  18997.         else
  18998.                    .
  18999.                    .
  19000.     }
  19001.  
  19002. </span><span class="style3">It is good programming practice to use this technique whenever a numerical constant is used, to help identify the purpose of this constant and to simplify future changes:
  19003.  
  19004.  
  19005.  
  19006. </span></text>
  19007.     </content>
  19008.     <content>
  19009.         <layer>background</layer>
  19010.         <id>7</id>
  19011.         <text>193</text>
  19012.     </content>
  19013.     <name></name>
  19014.     <script></script>
  19015. </card>
  19016.  
  19017.  
  19018. card_53025.xml
  19019. <?xml version="1.0" encoding="utf-8" ?>
  19020. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19021. <card>
  19022.     <id>53025</id>
  19023.     <filler1>0</filler1>
  19024.     <cantDelete> <false /> </cantDelete>
  19025.     <showPict> <true /> </showPict>
  19026.     <dontSearch> <false /> </dontSearch>
  19027.     <owner>4755</owner>
  19028.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19029.     <content>
  19030.         <layer>background</layer>
  19031.         <id>4</id>
  19032.         <text><span class="style4">   # define   MAX_ELEMENTS   1000
  19033.               .
  19034.               .
  19035.         float  f_array[MAX_ELEMENTS];
  19036.               .
  19037.               .
  19038.         for (i=0 ; i<MAX_ELEMENTS ; i++)
  19039.               .
  19040.               .
  19041. </span><span class="style3">
  19042. The replacement text may be any symbol or expression recognized by the compiler:
  19043. </span><span class="style4">
  19044.     # define   EQUALS    ==
  19045.              .
  19046.              .
  19047.         if (c  EQUALS  'x')
  19048.              .
  19049.              .
  19050.  
  19051. </span></text>
  19052.     </content>
  19053.     <content>
  19054.         <layer>background</layer>
  19055.         <id>7</id>
  19056.         <text>194</text>
  19057.     </content>
  19058.     <name></name>
  19059.     <script></script>
  19060. </card>
  19061.  
  19062.  
  19063. card_53429.xml
  19064. <?xml version="1.0" encoding="utf-8" ?>
  19065. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19066. <card>
  19067.     <id>53429</id>
  19068.     <filler1>0</filler1>
  19069.     <cantDelete> <false /> </cantDelete>
  19070.     <showPict> <true /> </showPict>
  19071.     <dontSearch> <false /> </dontSearch>
  19072.     <owner>4755</owner>
  19073.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19074.     <content>
  19075.         <layer>background</layer>
  19076.         <id>4</id>
  19077.         <text>Such macros can be used to extend the C language or even to write C programs using the syntax of another language entirely.  This is rarely done, however, since the source code becomes confusing to other programmers and more difficult to debug.
  19078.  
  19079. </text>
  19080.     </content>
  19081.     <content>
  19082.         <layer>background</layer>
  19083.         <id>7</id>
  19084.         <text>195</text>
  19085.     </content>
  19086.     <name></name>
  19087.     <script></script>
  19088. </card>
  19089.  
  19090.  
  19091. card_53649.xml
  19092. <?xml version="1.0" encoding="utf-8" ?>
  19093. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19094. <card>
  19095.     <id>53649</id>
  19096.     <filler1>0</filler1>
  19097.     <cantDelete> <false /> </cantDelete>
  19098.     <showPict> <true /> </showPict>
  19099.     <dontSearch> <false /> </dontSearch>
  19100.     <owner>4755</owner>
  19101.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19102.     <content>
  19103.         <layer>background</layer>
  19104.         <id>4</id>
  19105.         <text><span class="style3">ACRO SUBSTITUTION WITH PARAMETERS
  19106.  
  19107. Macros may be defined using parameters as well.  In this case the text passed as an "argument" is placed into the replacement text everywhere the parameter appears:
  19108. </span><span class="style4">
  19109.     # define   SQUARE(x)    x * x       // don't use this version! 
  19110.                   .
  19111.                   .
  19112.         f_array[i] = SQUARE(f_array[i]);
  19113.  
  19114. </span><span class="style3">After preprocessing, the "call" to the </span><span class="style4">SQUARE()</span><span class="style3"> macro expands to:
  19115. </span><span class="style4">
  19116.         f_array[i] = f_array[i] * f_array[i];
  19117.  
  19118. </span><span class="style3">However, there is a serious deficiency with the </span><span class="style4">SQUARE()</span><span class="style3"> macro defined above.  An expression like  "</span><span class="style4">c = 1./SQUARE(a + b)</span><span class="style3">"  expands to  "</span><span class="style4">c = 1./a + b * a + b</span><span class="style3">".  Due to the arithmetic precedence rules, this does not produce the desired result.  The preprocessor performs text substitution without regard for rules of C syntax.  The</span></text>
  19119.     </content>
  19120.     <content>
  19121.         <layer>background</layer>
  19122.         <id>7</id>
  19123.         <text>196</text>
  19124.     </content>
  19125.     <content>
  19126.         <layer>background</layer>
  19127.         <id>18</id>
  19128.         <text>p207</text>
  19129.     </content>
  19130.     <name></name>
  19131.     <script></script>
  19132. </card>
  19133.  
  19134.  
  19135. card_53898.xml
  19136. <?xml version="1.0" encoding="utf-8" ?>
  19137. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19138. <card>
  19139.     <id>53898</id>
  19140.     <filler1>0</filler1>
  19141.     <cantDelete> <false /> </cantDelete>
  19142.     <showPict> <true /> </showPict>
  19143.     <dontSearch> <false /> </dontSearch>
  19144.     <owner>4755</owner>
  19145.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19146.     <content>
  19147.         <layer>background</layer>
  19148.         <id>4</id>
  19149.         <text><span class="style3">olution is to define an improved version of this macro:
  19150. </span><span class="style4">
  19151.     # define        SQUARE(x)       ((x) * (x))
  19152.  
  19153. </span><span class="style3">In conclusion, it is generally wise to </span><span class="style7">enclose each occurence of the parameter in the replacement text with parentheses, and enclose the entire replacement text with parentheses</span><span class="style3">.
  19154.  
  19155. Macros with parameters may be more efficient than genuine functions which perform the same task, by eliminating the need for argument passing, variable allocation, etc.  On the other hand, the argument "passed" to a macro must be evaluated once for each occurence of the parameter in the replacement text.  If the argument is an expression which is difficult to evaluate, the macro may be </span><span class="style7">less</span><span class="style3"> efficient than an equivalent function.  For example, consider the "call":
  19156. </span><span class="style4">
  19157.         result = SQUARE( sqrt(SQUARE(sin(x))+SQUARE(cos(x)))+1. );
  19158.  
  19159. </span><span class="style3">The expression "passed" is evaluated twice after expansion of the macro.</span></text>
  19160.     </content>
  19161.     <content>
  19162.         <layer>background</layer>
  19163.         <id>7</id>
  19164.         <text>197</text>
  19165.     </content>
  19166.     <content>
  19167.         <layer>background</layer>
  19168.         <id>17</id>
  19169.         <text>p8</text>
  19170.     </content>
  19171.     <name></name>
  19172.     <script></script>
  19173. </card>
  19174.  
  19175.  
  19176. card_54588.xml
  19177. <?xml version="1.0" encoding="utf-8" ?>
  19178. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19179. <card>
  19180.     <id>54588</id>
  19181.     <filler1>0</filler1>
  19182.     <cantDelete> <false /> </cantDelete>
  19183.     <showPict> <true /> </showPict>
  19184.     <dontSearch> <false /> </dontSearch>
  19185.     <owner>4755</owner>
  19186.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19187.     <content>
  19188.         <layer>background</layer>
  19189.         <id>4</id>
  19190.         <text>Worse still, if the expression passed has side effects, such as an assignment expression, then the multiple evaluations may have particularly damaging results.  Therefore, expressions producing side effects should not be passed as "arguments" to macros.
  19191. </text>
  19192.     </content>
  19193.     <content>
  19194.         <layer>background</layer>
  19195.         <id>7</id>
  19196.         <text>198</text>
  19197.     </content>
  19198.     <content>
  19199.         <layer>background</layer>
  19200.         <id>17</id>
  19201.         <text>p8</text>
  19202.     </content>
  19203.     <name></name>
  19204.     <script></script>
  19205. </card>
  19206.  
  19207.  
  19208. card_52189.xml
  19209. <?xml version="1.0" encoding="utf-8" ?>
  19210. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19211. <card>
  19212.     <id>52189</id>
  19213.     <filler1>0</filler1>
  19214.     <cantDelete> <false /> </cantDelete>
  19215.     <showPict> <true /> </showPict>
  19216.     <dontSearch> <false /> </dontSearch>
  19217.     <owner>4755</owner>
  19218.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19219.     <content>
  19220.         <layer>background</layer>
  19221.         <id>6</id>
  19222.         <text>7.2  File Inclusion</text>
  19223.     </content>
  19224.     <content>
  19225.         <layer>background</layer>
  19226.         <id>4</id>
  19227.         <text><span class="style3">s mentioned earlier in this text, it is frequently convenient to place a list of declarations of user-defined data types and functions (as well as </span><span class="style4">#defined</span><span class="style3"> names) in a separate "header" file which may be accessed by various other source files.  This is accomplished with the </span><span class="style7">file inclusion</span><span class="style3"> preprocessor directive, usually placed at the beginning of a source file.  Its syntax is one of:
  19228. </span><span class="style4">
  19229.     # include   <standard library header file>
  19230.     # include   "user-defined header file"
  19231.  
  19232. </span><span class="style3">This directs the preprocessor to replace the </span><span class="style4">#include</span><span class="style3"> line with all the text contained in the named file.  Using quotes instead of</span><span class="style4"> <> </span><span class="style3">braces instructs the preprocessor to look for the file in the user's directory rather than that used by the system for standard header files.  For example, a source file using the</span><span class="style4"> printf() </span><span class="style3">standard library function declared in the standard header </span><span class="style18">stdio.h</span><span class="style3"> and the user-defined type </span><span class="style4">personnel_rec</span><span class="style3"> defined in the user's file </span><span class="style18">personnel.h</span><span class="style3"> should begin with:
  19233. </span><span class="style4">
  19234.     # include    <stdio.h>
  19235.     # include    "personnel.h"
  19236. </span><span class="style3">
  19237.  
  19238.  
  19239.  
  19240. </span></text>
  19241.     </content>
  19242.     <content>
  19243.         <layer>background</layer>
  19244.         <id>7</id>
  19245.         <text>199</text>
  19246.     </content>
  19247.     <content>
  19248.         <layer>background</layer>
  19249.         <id>17</id>
  19250.         <text>p189</text>
  19251.     </content>
  19252.     <name></name>
  19253.     <script></script>
  19254. </card>
  19255.  
  19256.  
  19257. card_54204.xml
  19258. <?xml version="1.0" encoding="utf-8" ?>
  19259. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19260. <card>
  19261.     <id>54204</id>
  19262.     <filler1>0</filler1>
  19263.     <cantDelete> <false /> </cantDelete>
  19264.     <showPict> <true /> </showPict>
  19265.     <dontSearch> <false /> </dontSearch>
  19266.     <owner>4755</owner>
  19267.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19268.     <content>
  19269.         <layer>background</layer>
  19270.         <id>4</id>
  19271.         <text><span class="style3">y convention header files use the extension "</span><span class="style18">.h</span><span class="style3">" rather than the "</span><span class="style18">.c</span><span class="style3">" extension for C source files.  While header files may contain any legal C code, it is good practice to limit this code to variable and function declarations and preprocessor directives.  If an external variable is defined (allocated) or a complete function definition is given,
  19272. then errors may occur when the overall program is linked (i.e., when the compiled source files and the standard function libraries are combined into an executable application).  The reason is that the header may need to be</span><span class="style4"> #included </span><span class="style3">into several source files, leading to multiple definitions for the same variable or function.
  19273.  
  19274.  
  19275.  
  19276.  
  19277.  
  19278.   </span></text>
  19279.     </content>
  19280.     <content>
  19281.         <layer>background</layer>
  19282.         <id>7</id>
  19283.         <text>200</text>
  19284.     </content>
  19285.     <content>
  19286.         <layer>background</layer>
  19287.         <id>17</id>
  19288.         <text>p249</text>
  19289.     </content>
  19290.     <name></name>
  19291.     <script></script>
  19292. </card>
  19293.  
  19294.  
  19295. card_54516.xml
  19296. <?xml version="1.0" encoding="utf-8" ?>
  19297. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19298. <card>
  19299.     <id>54516</id>
  19300.     <filler1>0</filler1>
  19301.     <cantDelete> <false /> </cantDelete>
  19302.     <showPict> <true /> </showPict>
  19303.     <dontSearch> <false /> </dontSearch>
  19304.     <owner>4755</owner>
  19305.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19306.     <content>
  19307.         <layer>background</layer>
  19308.         <id>4</id>
  19309.         <text><span class="style3">C/C++ CONSIDERATIONS
  19310.  
  19311. When taking advantage of the ability to define classes in Think C and C++, it is common practice to place each class definition in a header file, and the definitions of the member functions of the class in a separate source file.  In the example in Chapter 4 the </span><span class="style4">Person</span><span class="style3"> class was defined in </span><span class="style18">person.h</span><span class="style3"> and its methods in </span><span class="style18">person.c</span><span class="style3">.  The source file </span><span class="style4">#includes</span><span class="style3"> the corresponding header, as do all files which make use of the </span><span class="style4">Person</span><span class="style3"> class definition; namely </span><span class="style18">student.h</span><span class="style3"> and </span><span class="style18">main.c</span><span class="style3">.
  19312. </span><span class="style4">
  19313. </span><span class="style3">Notice that </span><span class="style18">main.c</span><span class="style3"> </span><span class="style4">#includes</span><span class="style3"> </span><span class="style18">student.h</span><span class="style3"> as well.  This suggests that the contents of </span><span class="style18">person.h</span><span class="style3"> are included twice in </span><span class="style18">main.c</span><span class="style3">, producing an error due to duplicate definition.  To avoid this, Think C allows the programmer to place the directive:
  19314. </span><span class="style4">
  19315.     # pragma   once          // Think C only
  19316.  
  19317. </span><span class="style3">at the beginning of the header </span><span class="style18">person.h</span><span class="style3">.  This ensures the file's contents are compiled only once.  A </span><span class="style4">#pragma</span><span class="style3"> directive is one which is defined only for a particular compiler.  C++ conditional compilation must be made explicitly, as discussed in the
  19318.  
  19319.  
  19320. </span></text>
  19321.     </content>
  19322.     <content>
  19323.         <layer>background</layer>
  19324.         <id>7</id>
  19325.         <text>201</text>
  19326.     </content>
  19327.     <content>
  19328.         <layer>background</layer>
  19329.         <id>17</id>
  19330.         <text>p249</text>
  19331.     </content>
  19332.     <name></name>
  19333.     <script></script>
  19334. </card>
  19335.  
  19336.  
  19337. card_54839.xml
  19338. <?xml version="1.0" encoding="utf-8" ?>
  19339. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19340. <card>
  19341.     <id>54839</id>
  19342.     <filler1>0</filler1>
  19343.     <cantDelete> <false /> </cantDelete>
  19344.     <showPict> <true /> </showPict>
  19345.     <dontSearch> <false /> </dontSearch>
  19346.     <owner>4755</owner>
  19347.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19348.     <content>
  19349.         <layer>background</layer>
  19350.         <id>4</id>
  19351.         <text><span class="style3">ollowing section.
  19352.  
  19353. Occasionally this arrangement may lead to difficulties.  Consider a circular definition involving two classes:
  19354. </span><span class="style4">
  19355.     struct    Person:Generic_Class
  19356.     {
  19357.         Parent      *parent_ptr;
  19358.               .
  19359.               .
  19360.     };
  19361.  
  19362.     struct    Parent:Person
  19363.     {
  19364.               .
  19365.               .
  19366.     };
  19367.  
  19368. </span><span class="style3">The </span><span class="style4">Person</span><span class="style3"> class contains an instance variable which is a pointer to a </span><span class="style4">Parent</span><span class="style3"> object, and the </span><span class="style4">Parent</span><span class="style3"> class is descended from the </span><span class="style4">Person</span><span class="style3"> class.  (This makes sense, since a </span></text>
  19369.     </content>
  19370.     <content>
  19371.         <layer>background</layer>
  19372.         <id>7</id>
  19373.         <text>202</text>
  19374.     </content>
  19375.     <content>
  19376.         <layer>background</layer>
  19377.         <id>17</id>
  19378.         <text>p249</text>
  19379.     </content>
  19380.     <name></name>
  19381.     <script></script>
  19382. </card>
  19383.  
  19384.  
  19385. card_55248.xml
  19386. <?xml version="1.0" encoding="utf-8" ?>
  19387. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19388. <card>
  19389.     <id>55248</id>
  19390.     <filler1>0</filler1>
  19391.     <cantDelete> <false /> </cantDelete>
  19392.     <showPict> <true /> </showPict>
  19393.     <dontSearch> <false /> </dontSearch>
  19394.     <owner>4755</owner>
  19395.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19396.     <content>
  19397.         <layer>background</layer>
  19398.         <id>4</id>
  19399.         <text><span class="style3">arent is a type of person, yet each person has a parent.)
  19400.  
  19401. Suppose these classes are defined in the header files </span><span class="style18">person.h</span><span class="style3"> and </span><span class="style18">parent.h</span><span class="style3">, each of which contains conditional compilation directives to prevent multiple inclusion.  The header </span><span class="style18">person.h</span><span class="style3"> must </span><span class="style4">#include</span><span class="style3"> </span><span class="style18">parent.h</span><span class="style3"> to compile properly, which in turn must </span><span class="style4">#include</span><span class="style3"> </span><span class="style18">person.h</span><span class="style3">!  However, since by this point </span><span class="style18">person.h</span><span class="style3"> has already begun compilation the conditional compilation feature will prevent its reinclusion.  This will prevent the successful compilation of files </span><span class="style4">#including</span><span class="style3"> these headers.
  19402. </span><span class="style4">
  19403. </span><span class="style3">Instead, the following technique may be used.  One of the two headers ‚Äî </span><span class="style18">parent.h</span><span class="style3"> ‚Äî may be written as usual, with a directive to </span><span class="style4">#include</span><span class="style3"> </span><span class="style18">person.h</span><span class="style3"> at the beginning of the file.  At the beginning of the file </span><span class="style18">person.h</span><span class="style3"> must contain the line:
  19404. </span><span class="style4">
  19405.     struct   Parent;    // inform the compiler that Parent is a struct "tag" 
  19406.  
  19407. </span><span class="style3">This "tag" declaration is sufficient to complete the circular definition of the </span><span class="style4">Person</span><span class="style3"> class, as long as references to "</span><span class="style4">Parent</span><span class="style3">" in this header are replaced by "</span><span class="style4">struct Parent</span><span class="style3">".  However, a source file which </span><span class="style4">#includes</span><span class="style3"> </span><span class="style18">person.h</span><span class="style3"> might require a complete </span></text>
  19408.     </content>
  19409.     <content>
  19410.         <layer>background</layer>
  19411.         <id>7</id>
  19412.         <text>203</text>
  19413.     </content>
  19414.     <content>
  19415.         <layer>background</layer>
  19416.         <id>17</id>
  19417.         <text>p249</text>
  19418.     </content>
  19419.     <name></name>
  19420.     <script></script>
  19421. </card>
  19422.  
  19423.  
  19424. card_47917.xml
  19425. <?xml version="1.0" encoding="utf-8" ?>
  19426. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19427. <card>
  19428.     <id>47917</id>
  19429.     <filler1>0</filler1>
  19430.     <cantDelete> <false /> </cantDelete>
  19431.     <showPict> <true /> </showPict>
  19432.     <dontSearch> <false /> </dontSearch>
  19433.     <owner>4755</owner>
  19434.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19435.     <content>
  19436.         <layer>background</layer>
  19437.         <id>4</id>
  19438.         <text><span class="style3">efinition of the </span><span class="style4">Parent</span><span class="style3"> class.  This is ensured by placing a directive to </span><span class="style4">#include</span><span class="style3"> </span><span class="style18">parent.h</span><span class="style3"> at the </span><span class="style7">end</span><span class="style3"> of the file </span><span class="style18">person.h</span><span class="style3">.
  19439.  
  19440. If the </span><span class="style4">class</span><span class="style3"> keyword is used in place of </span><span class="style4">struct</span><span class="style3"> to define these classes, then a similar approach is taken.  The line
  19441. </span><span class="style4">
  19442.     class   Parent;    // inform the compiler that Parent is a class 
  19443.  
  19444. </span><span class="style3">is placed at the beginning of the file </span><span class="style18">person.h</span><span class="style3"> in lieu of </span><span class="style4">#including</span><span class="style3"> </span><span class="style18">parent.h</span><span class="style3">.  The header </span><span class="style18">parent.h</span><span class="style3"> is </span><span class="style4">#included</span><span class="style3"> at the </span><span class="style7">end</span><span class="style3"> of </span><span class="style18">person.h</span><span class="style3">.  In this case, it is </span><span class="style7">not</span><span class="style3"> necessary to replace all references to "</span><span class="style4">Parent</span><span class="style3">" in </span><span class="style18">person.h</span><span class="style3"> with "</span><span class="style4">class Parent</span><span class="style3">".</span></text>
  19445.     </content>
  19446.     <content>
  19447.         <layer>background</layer>
  19448.         <id>7</id>
  19449.         <text>204</text>
  19450.     </content>
  19451.     <content>
  19452.         <layer>background</layer>
  19453.         <id>17</id>
  19454.         <text>p249</text>
  19455.     </content>
  19456.     <name></name>
  19457.     <script></script>
  19458. </card>
  19459.  
  19460.  
  19461. card_52411.xml
  19462. <?xml version="1.0" encoding="utf-8" ?>
  19463. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19464. <card>
  19465.     <id>52411</id>
  19466.     <filler1>0</filler1>
  19467.     <cantDelete> <false /> </cantDelete>
  19468.     <showPict> <true /> </showPict>
  19469.     <dontSearch> <false /> </dontSearch>
  19470.     <owner>4755</owner>
  19471.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19472.     <content>
  19473.         <layer>background</layer>
  19474.         <id>6</id>
  19475.         <text>7.3  Conditional Compilation</text>
  19476.     </content>
  19477.     <content>
  19478.         <layer>background</layer>
  19479.         <id>4</id>
  19480.         <text><span class="style3">ften it is desired that a program compile correctly under two or more different circumstances.  In such cases, it is convenient to write a single collection of source and header files, using preprocessor directives to ensure correct compilation for the respective circumstances.  The syntax:
  19481. </span><span class="style4">
  19482.     # define   NAME          // no replacement text given 
  19483.  
  19484. </span><span class="style3">is used to "define" a name for use with the </span><span class="style7">conditional compilation</span><span class="style3"> directives:
  19485. </span><span class="style4">
  19486.     # ifdef   NAME
  19487.            .
  19488.            .
  19489.     # else
  19490.            .
  19491.            .
  19492.     # endif
  19493.  
  19494. </span><span class="style3">If</span><span class="style4"> NAME </span><span class="style3">has been "defined" before the</span><span class="style4"> #ifdef </span><span class="style3">directive is encountered, then the
  19495.  
  19496. </span></text>
  19497.     </content>
  19498.     <content>
  19499.         <layer>background</layer>
  19500.         <id>7</id>
  19501.         <text>205</text>
  19502.     </content>
  19503.     <content>
  19504.         <layer>background</layer>
  19505.         <id>17</id>
  19506.         <text>p249</text>
  19507.     </content>
  19508.     <name></name>
  19509.     <script></script>
  19510. </card>
  19511.  
  19512.  
  19513. card_55372.xml
  19514. <?xml version="1.0" encoding="utf-8" ?>
  19515. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19516. <card>
  19517.     <id>55372</id>
  19518.     <filler1>0</filler1>
  19519.     <cantDelete> <false /> </cantDelete>
  19520.     <showPict> <true /> </showPict>
  19521.     <dontSearch> <false /> </dontSearch>
  19522.     <owner>4755</owner>
  19523.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19524.     <content>
  19525.         <layer>background</layer>
  19526.         <id>4</id>
  19527.         <text><span class="style3">ource code between the</span><span class="style4"> #ifdef </span><span class="style3">and the</span><span class="style4"> #else </span><span class="style3">(if present) is compiled.  Otherwise the source code between</span><span class="style4"> #else </span><span class="style3">and</span><span class="style4"> #endif </span><span class="style3">is compiled.  The programmer places source code appropriate to only one circumstance following the</span><span class="style4"> #ifdef </span><span class="style3">and code for the other circumstance following the</span><span class="style4"> #else</span><span class="style3">.  Thus, with only a single change ‚Äî incorporation of the appropriate</span><span class="style4"> #define </span><span class="style3">directive ‚Äî source code appropriate to the chosen circumstance may be compiled.
  19528.  
  19529. For example, it may be desired that a program compile under two slightly different C compilers, having different names for the header file for standard string functions:
  19530. </span><span class="style4">
  19531.     # define    CCOMP1       // remove this line for alternate compiler 
  19532.               .
  19533.               .
  19534.     # ifdef     CCOMP1
  19535.     # include  <string.h>
  19536.     # else
  19537.     # include  <strings.h>
  19538.     # endif</span></text>
  19539.     </content>
  19540.     <content>
  19541.         <layer>background</layer>
  19542.         <id>7</id>
  19543.         <text>206</text>
  19544.     </content>
  19545.     <content>
  19546.         <layer>background</layer>
  19547.         <id>17</id>
  19548.         <text>p8</text>
  19549.     </content>
  19550.     <name></name>
  19551.     <script></script>
  19552. </card>
  19553.  
  19554.  
  19555. card_56532.xml
  19556. <?xml version="1.0" encoding="utf-8" ?>
  19557. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19558. <card>
  19559.     <id>56532</id>
  19560.     <filler1>0</filler1>
  19561.     <cantDelete> <false /> </cantDelete>
  19562.     <showPict> <true /> </showPict>
  19563.     <dontSearch> <false /> </dontSearch>
  19564.     <owner>4755</owner>
  19565.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19566.     <content>
  19567.         <layer>background</layer>
  19568.         <id>4</id>
  19569.         <text><span class="style3">nother use of conditional compilation is to avoid reinclusion of header files which are themselves</span><span class="style4"> #included </span><span class="style3">into other headers, a common problem in object-oriented programs.  (TC provides a simpler method to accomplish this.*)  For a header file named </span><span class="style18">filename.h</span><span class="style3">, a common approach is to begin the file with:
  19570. </span><span class="style4">
  19571.     # ifndef   filename_h      // like #ifdef, but means "if not defined" 
  19572.     # define   filename_h
  19573.  
  19574. </span><span class="style3">and end the file with:
  19575. </span><span class="style4">
  19576.     # endif
  19577.  
  19578. </span><span class="style3">Also, note that it is legal to nest</span><span class="style4"> #ifdef/#endif </span><span class="style3">conditions.
  19579.  
  19580. Certain names are</span><span class="style4"> #defined </span><span class="style3">automatically by the compiler in use.  For example, the name </span><span class="style4">THINK_C</span><span class="style3"> is defined whenever the TC compiler is used.  Conditional compilation based on automatically-defined names can help improve portability by restricting compilation of non-standard portions of the code to specific compilers.</span></text>
  19581.     </content>
  19582.     <content>
  19583.         <layer>background</layer>
  19584.         <id>7</id>
  19585.         <text>207</text>
  19586.     </content>
  19587.     <content>
  19588.         <layer>background</layer>
  19589.         <id>29</id>
  19590.         <text>54516</text>
  19591.     </content>
  19592.     <content>
  19593.         <layer>background</layer>
  19594.         <id>27</id>
  19595.         <text>TC feature to prevent header reinclusion</text>
  19596.     </content>
  19597.     <content>
  19598.         <layer>background</layer>
  19599.         <id>20</id>
  19600.         <text>TC feature to prevent header reinclusion - p201</text>
  19601.     </content>
  19602.     <content>
  19603.         <layer>background</layer>
  19604.         <id>17</id>
  19605.         <text>p8</text>
  19606.     </content>
  19607.     <name></name>
  19608.     <script></script>
  19609. </card>
  19610.  
  19611.  
  19612. card_21751.xml
  19613. <?xml version="1.0" encoding="utf-8" ?>
  19614. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19615. <card>
  19616.     <id>21751</id>
  19617.     <filler1>0</filler1>
  19618.     <cantDelete> <false /> </cantDelete>
  19619.     <showPict> <true /> </showPict>
  19620.     <dontSearch> <false /> </dontSearch>
  19621.     <owner>4755</owner>
  19622.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19623.     <content>
  19624.         <layer>background</layer>
  19625.         <id>6</id>
  19626.         <text>8.  Standard Function Libraries</text>
  19627.     </content>
  19628.     <content>
  19629.         <layer>background</layer>
  19630.         <id>7</id>
  19631.         <text>208</text>
  19632.     </content>
  19633.     <content>
  19634.         <layer>background</layer>
  19635.         <id>4</id>
  19636.         <text><span class="style3">'s efficiency is granted in part by its stripped-down design.  At the same time, C is made extremely powerful and flexible by the addition of </span><span class="style7">standard function libraries</span><span class="style3"> for input/output, mathematics, string manipulation, and memory management.  Programs making use solely of these functions are generally portable (or can be made so with judicious use of conditional compilation*).  In Think C the ANSI library contains all these standard functions.
  19637.  
  19638. In addition, many C compilers provide specialized function libraries appropriate to the intended hardware or application area.  These further enhance the language's power while compromising portability.  TC's MacTraps library actually consists of calls to the Macintosh ROM "Toolbox" routines which accomplish the graphical user interface and many other functions.  This "library" allows Macintosh C programmers to call these routines as though they were C functions.  Appendix 1 describes using libraries with TC projects.
  19639.  
  19640. Programmers may also create their own libraries of related, frequently-used routines.
  19641.  
  19642. </span></text>
  19643.     </content>
  19644.     <content>
  19645.         <layer>background</layer>
  19646.         <id>29</id>
  19647.         <text>52411</text>
  19648.     </content>
  19649.     <content>
  19650.         <layer>background</layer>
  19651.         <id>27</id>
  19652.         <text>Conditional compilation</text>
  19653.     </content>
  19654.     <content>
  19655.         <layer>background</layer>
  19656.         <id>20</id>
  19657.         <text>Conditional compilation - p205</text>
  19658.     </content>
  19659.     <content>
  19660.         <layer>background</layer>
  19661.         <id>17</id>
  19662.         <text>p223</text>
  19663.     </content>
  19664.     <name></name>
  19665.     <script></script>
  19666. </card>
  19667.  
  19668.  
  19669. card_56733.xml
  19670. <?xml version="1.0" encoding="utf-8" ?>
  19671. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19672. <card>
  19673.     <id>56733</id>
  19674.     <filler1>0</filler1>
  19675.     <cantDelete> <false /> </cantDelete>
  19676.     <showPict> <true /> </showPict>
  19677.     <dontSearch> <false /> </dontSearch>
  19678.     <owner>4755</owner>
  19679.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19680.     <content>
  19681.         <layer>background</layer>
  19682.         <id>4</id>
  19683.         <text><span class="style3">sually the functions defined in standard, specialized, or user-defined libraries are declared (their prototypes are given) in header files.  The appropriate header should be </span><span class="style4">#included</span><span class="style3"> into any source file accessing these functions.*  Note that some functions are implemented as macros in the standard header file.
  19684.  
  19685. (In truth, the user may provide the appropriate function prototypes himself/herself instead of </span><span class="style4">#including</span><span class="style3"> the standard header file.  This is a dangerous practice since future versions of the compiler may change the function implementation slightly, causing the user's prototype to be inaccurate.  Portability is also jeapordized.)
  19686.  
  19687. This chapter describes only a sampling of frequently-used functions from the standard C function libraries.  A C reference text or manual should be consulted for greater breadth and detail.  Consult the documentation for your own compiler to see what specialized libraries are available, if portability is not crucial.
  19688.  
  19689. The object-oriented nature of Think C and C++ encourages the use of </span><span class="style7">class libraries</span><span class="style3"> instead of or in addition to function libraries.  These are discussed in Chapter 9.
  19690. </span></text>
  19691.     </content>
  19692.     <content>
  19693.         <layer>background</layer>
  19694.         <id>7</id>
  19695.         <text>209</text>
  19696.     </content>
  19697.     <content>
  19698.         <layer>background</layer>
  19699.         <id>29</id>
  19700.         <text>52189
  19701. </text>
  19702.     </content>
  19703.     <content>
  19704.         <layer>background</layer>
  19705.         <id>27</id>
  19706.         <text>File inclusion
  19707. </text>
  19708.     </content>
  19709.     <content>
  19710.         <layer>background</layer>
  19711.         <id>20</id>
  19712.         <text>File inclusion - p199</text>
  19713.     </content>
  19714.     <name></name>
  19715.     <script></script>
  19716. </card>
  19717.  
  19718.  
  19719. card_33614.xml
  19720. <?xml version="1.0" encoding="utf-8" ?>
  19721. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19722. <card>
  19723.     <id>33614</id>
  19724.     <filler1>0</filler1>
  19725.     <cantDelete> <false /> </cantDelete>
  19726.     <showPict> <true /> </showPict>
  19727.     <dontSearch> <false /> </dontSearch>
  19728.     <owner>4755</owner>
  19729.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19730.     <content>
  19731.         <layer>background</layer>
  19732.         <id>6</id>
  19733.         <text>8.1  I/O Functions</text>
  19734.     </content>
  19735.     <content>
  19736.         <layer>background</layer>
  19737.         <id>7</id>
  19738.         <text>210</text>
  19739.     </content>
  19740.     <content>
  19741.         <layer>background</layer>
  19742.         <id>4</id>
  19743.         <text><span class="style3">'s standard I/O (input/output) functions are contained in the ANSI library.  The standard header file </span><span class="style18">stdio.h</span><span class="style3"> contains declarations for these functions; i.e., any source file which uses standard I/O functions should contain the preprocessor directive:
  19744. </span><span class="style4">
  19745.     # include   <stdio.h>
  19746.  
  19747. </span><span class="style3">In practice, professional Macintosh C programs often call the Macintosh Toolbox routines (via the MacTraps specialized library) to accomplish the user interface rather than use the standard I/O library.  This technique produces efficient but non-portable programs which take full advantage of the Macintosh's hardware capabilities.  Nonetheless, the standard I/O functions are useful for producing portable programs where a command-line user interface is tolerated.
  19748.  
  19749. The standard ANSI I/O functions treat input and output as "streams" of bytes or characters, which are written to and read from binary or text files or I/O devices.  The procedure for addressing such a file or device is:  first "open" the stream; then perform I/O; then "close" the stream.</span></text>
  19750.     </content>
  19751.     <content>
  19752.         <layer>background</layer>
  19753.         <id>17</id>
  19754.         <text>p223</text>
  19755.     </content>
  19756.     <name></name>
  19757.     <script></script>
  19758. </card>
  19759.  
  19760.  
  19761. card_57294.xml
  19762. <?xml version="1.0" encoding="utf-8" ?>
  19763. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19764. <card>
  19765.     <id>57294</id>
  19766.     <filler1>0</filler1>
  19767.     <cantDelete> <false /> </cantDelete>
  19768.     <showPict> <true /> </showPict>
  19769.     <dontSearch> <false /> </dontSearch>
  19770.     <owner>4755</owner>
  19771.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19772.     <content>
  19773.         <layer>background</layer>
  19774.         <id>4</id>
  19775.         <text><span class="style3">TANDARD STREAMS
  19776.  
  19777. Three streams are automatically opened when a C program begins execution:  stdin, stdout, and stderr.  These represent the standard input device, standard output device, and the device for reporting errors, respectively.
  19778.  
  19779. By default these devices usually refer to the user's terminal.  TC automatically creates a "console" text window on the Macintosh when a function refers to one of these streams.  (On UNIX systems these streams can be "redirected" to refer to text files, and this may be emulated on the Macintosh using TC's</span><span class="style4"> ccommand() </span><span class="style3">function.)
  19780.  
  19781. The powerful </span><span class="style4">printf()</span><span class="style3"> and </span><span class="style4">scanf()</span><span class="style3"> standard functions write to and read from the standard output and standard input devices.  Their prototypes are:
  19782. </span><span class="style4">
  19783.     int   printf(const char *format, ...);  // variable number of arguments 
  19784.     int   scanf(const char *format, ...);
  19785.  
  19786. </span><span class="style3">The format string contains conversion codes such as </span><span class="style4">%d</span><span class="style3"> (integer value), </span><span class="style4">%ld</span><span class="style3"> (long </span></text>
  19787.     </content>
  19788.     <content>
  19789.         <layer>background</layer>
  19790.         <id>7</id>
  19791.         <text>211</text>
  19792.     </content>
  19793.     <name></name>
  19794.     <script></script>
  19795. </card>
  19796.  
  19797.  
  19798. card_57526.xml
  19799. <?xml version="1.0" encoding="utf-8" ?>
  19800. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19801. <card>
  19802.     <id>57526</id>
  19803.     <filler1>0</filler1>
  19804.     <cantDelete> <false /> </cantDelete>
  19805.     <showPict> <true /> </showPict>
  19806.     <dontSearch> <false /> </dontSearch>
  19807.     <owner>4755</owner>
  19808.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19809.     <content>
  19810.         <layer>background</layer>
  19811.         <id>4</id>
  19812.         <text><span class="style3">nteger), </span><span class="style4">%c</span><span class="style3"> (character), </span><span class="style4">%s</span><span class="style3"> (string), </span><span class="style4">%g</span><span class="style3"> (float), </span><span class="style4">%lg</span><span class="style3"> (double).  The format string in </span><span class="style4">printf()</span><span class="style3"> may contain text mixed with the format codes.  Following the format string is a variable number of arguments, each of which corresponds to a conversion code in the format string.  For </span><span class="style4">printf()</span><span class="style3"> these arguments are values to be written to stdout, while for </span><span class="style4">scanf()</span><span class="style3"> they should be the addresses of the variables into which values from stdin will be read.
  19813.  
  19814. Chapters 1, 3, and 4 contain numerous examples of the use of </span><span class="style4">printf()</span><span class="style3"> and </span><span class="style4">scanf()</span><span class="style3">.</span></text>
  19815.     </content>
  19816.     <content>
  19817.         <layer>background</layer>
  19818.         <id>7</id>
  19819.         <text>212</text>
  19820.     </content>
  19821.     <content>
  19822.         <layer>background</layer>
  19823.         <id>17</id>
  19824.         <text>p212</text>
  19825.     </content>
  19826.     <name></name>
  19827.     <script></script>
  19828. </card>
  19829.  
  19830.  
  19831. card_57613.xml
  19832. <?xml version="1.0" encoding="utf-8" ?>
  19833. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19834. <card>
  19835.     <id>57613</id>
  19836.     <filler1>0</filler1>
  19837.     <cantDelete> <false /> </cantDelete>
  19838.     <showPict> <true /> </showPict>
  19839.     <dontSearch> <false /> </dontSearch>
  19840.     <owner>4755</owner>
  19841.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19842.     <content>
  19843.         <layer>background</layer>
  19844.         <id>4</id>
  19845.         <text><span class="style3">ILE I/O
  19846.  
  19847. To read from and write to files, the appropriate stream should first be opened via the standard library function</span><span class="style4"> fopen()</span><span class="style3">, whose prototype is:
  19848. </span><span class="style4">
  19849.     FILE   *fopen(const char *filename, const char *description);
  19850.  
  19851. </span><span class="style3">The filename and description arguments specify the name of the file and how it will be used, such as "r" for reading a text stream and "w" for writing to a text stream.  The return value is a pointer to a </span><span class="style4">FILE</span><span class="style3"> type: a data structure defined in </span><span class="style18">stdio.h</span><span class="style3"> identifying the characteristics of the I/O device specified.
  19852.  
  19853. The</span><span class="style4"> fprintf()</span><span class="style3"> and </span><span class="style4">fscanf()</span><span class="style3"> functions are very similar to </span><span class="style4">printf()</span><span class="style3"> and </span><span class="style4">scanf()</span><span class="style3"> except that their first argument is a </span><span class="style4">FILE</span><span class="style3"> pointer:
  19854. </span><span class="style4">
  19855.     int   fprintf(FILE *stream, const char *format_string, ...);
  19856.     int   fscanf(FILE *stream, const char *format_string, ...);</span></text>
  19857.     </content>
  19858.     <content>
  19859.         <layer>background</layer>
  19860.         <id>7</id>
  19861.         <text>213</text>
  19862.     </content>
  19863.     <name></name>
  19864.     <script></script>
  19865. </card>
  19866.  
  19867.  
  19868. card_58064.xml
  19869. <?xml version="1.0" encoding="utf-8" ?>
  19870. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19871. <card>
  19872.     <id>58064</id>
  19873.     <filler1>0</filler1>
  19874.     <cantDelete> <false /> </cantDelete>
  19875.     <showPict> <true /> </showPict>
  19876.     <dontSearch> <false /> </dontSearch>
  19877.     <owner>4755</owner>
  19878.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19879.     <content>
  19880.         <layer>background</layer>
  19881.         <id>4</id>
  19882.         <text><span class="style3">he </span><span class="style4">fclose()</span><span class="style3"> function should be used to close the stream and its associated file after use.  For example, to write text to the file </span><span class="style18">output.fil</span><span class="style3">:
  19883. </span><span class="style4">
  19884.     # include  <stdio.h>
  19885.                 .
  19886.                 .
  19887.         FILE   *fp;                 // declare pointer to a FILE type 
  19888.         fp = fopen("output.fil","w");     // creates new file if non-existant 
  19889.         if (fp != NULL)
  19890.         {   fprintf(fp,"Here's some output: %d\n",99);
  19891.             fclose(fp);
  19892.         }
  19893.  
  19894. </span><span class="style3">Note that </span><span class="style4">fopen()</span><span class="style3"> returns the </span><span class="style4">NULL</span><span class="style3"> pointer (defined in </span><span class="style18">stddef.h</span><span class="style3">) if it is unable to open the stream.
  19895.  
  19896. There are many other useful standard I/O functions available for binary I/O, non-sequential access, etc.</span></text>
  19897.     </content>
  19898.     <content>
  19899.         <layer>background</layer>
  19900.         <id>7</id>
  19901.         <text>214</text>
  19902.     </content>
  19903.     <content>
  19904.         <layer>background</layer>
  19905.         <id>17</id>
  19906.         <text>p215</text>
  19907.     </content>
  19908.     <name></name>
  19909.     <script></script>
  19910. </card>
  19911.  
  19912.  
  19913. card_34612.xml
  19914. <?xml version="1.0" encoding="utf-8" ?>
  19915. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19916. <card>
  19917.     <id>34612</id>
  19918.     <filler1>0</filler1>
  19919.     <cantDelete> <false /> </cantDelete>
  19920.     <showPict> <true /> </showPict>
  19921.     <dontSearch> <false /> </dontSearch>
  19922.     <owner>4755</owner>
  19923.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19924.     <content>
  19925.         <layer>background</layer>
  19926.         <id>6</id>
  19927.         <text>8.2  Math Functions</text>
  19928.     </content>
  19929.     <content>
  19930.         <layer>background</layer>
  19931.         <id>7</id>
  19932.         <text>215</text>
  19933.     </content>
  19934.     <content>
  19935.         <layer>background</layer>
  19936.         <id>4</id>
  19937.         <text><span class="style3">'s standard math functions are contained in the ANSI library.  The standard header file </span><span class="style18">math.h</span><span class="style3"> contains declarations for these functions:
  19938. </span><span class="style4">
  19939.     # include   <math.h>
  19940.  
  19941. </span><span class="style3">C does not provide an exponentiation operator; instead the standard </span><span class="style4">pow()</span><span class="style3"> function is used.  This function returns x raised to the power y.  If x is negative then y must be integral.  Its prototype is:
  19942. </span><span class="style4">
  19943.     double  pow(double  x, double  y);
  19944.  
  19945. </span><span class="style3">The </span><span class="style4">sqrt()</span><span class="style3"> function returns the (double precision) square root of its argument.  Most of the common trigonometric functions are also available, returning doubles:  </span><span class="style4">sin()</span><span class="style3">, </span><span class="style4">cos()</span><span class="style3">, </span><span class="style4">tan()</span><span class="style3">, </span><span class="style4">asin()</span><span class="style3">, </span><span class="style4">acos()</span><span class="style3">, </span><span class="style4">atan</span><span class="style3">, </span><span class="style4">exp()</span><span class="style3">, </span><span class="style4">log()</span><span class="style3">, </span><span class="style4">log10()</span><span class="style3">, </span><span class="style4">cosh()</span><span class="style3">, </span><span class="style4">sinh()</span><span class="style3">, </span><span class="style4">tanh()</span><span class="style3">.  The </span><span class="style4">abs()</span><span class="style3"> function computes the absolute value of an integer while </span><span class="style4">fabs()</span><span class="style3"> works for doubles.</span></text>
  19946.     </content>
  19947.     <content>
  19948.         <layer>background</layer>
  19949.         <id>17</id>
  19950.         <text>p223</text>
  19951.     </content>
  19952.     <name></name>
  19953.     <script></script>
  19954. </card>
  19955.  
  19956.  
  19957. card_34876.xml
  19958. <?xml version="1.0" encoding="utf-8" ?>
  19959. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  19960. <card>
  19961.     <id>34876</id>
  19962.     <filler1>0</filler1>
  19963.     <cantDelete> <false /> </cantDelete>
  19964.     <showPict> <true /> </showPict>
  19965.     <dontSearch> <false /> </dontSearch>
  19966.     <owner>4755</owner>
  19967.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  19968.     <content>
  19969.         <layer>background</layer>
  19970.         <id>6</id>
  19971.         <text>8.3  String Handling Functions</text>
  19972.     </content>
  19973.     <content>
  19974.         <layer>background</layer>
  19975.         <id>7</id>
  19976.         <text>216</text>
  19977.     </content>
  19978.     <content>
  19979.         <layer>background</layer>
  19980.         <id>4</id>
  19981.         <text><span class="style3">hile the language itself provides little assistance with handling character strings, the standard string functions (contained in the ANSI library) give C programmers the capability to manipulate strings easily.  These functions are declared in </span><span class="style18">string.h</span><span class="style3">:
  19982. </span><span class="style4">
  19983.     # include  <string.h>
  19984.  
  19985. </span><span class="style3">Strings in C are character arrays terminated with the null character '</span><span class="style4">\0</span><span class="style3">' (backslash- zero).  Since the name of an array is a pointer to the beginning of the array, most of the standard string functions accept a character pointer as an argument.  A string constant is a sequence of characters enclosed in double quotes.  The null character is provided automatically and the constant is treated as an array name.  Since C does not provide built-in array copying capability, the </span><span class="style4">strcpy()</span><span class="style3"> function is used:
  19986. </span><span class="style4">
  19987.     char   str1[80];
  19988.     strcpy(str1,"Hello, world!");
  19989.  
  19990. </span><span class="style3">The </span><span class="style4">strcpy()</span><span class="style3"> function copies each character of the string pointed to by its second argument to the corresponding element of the string pointed to by its first argument</span></text>
  19991.     </content>
  19992.     <content>
  19993.         <layer>background</layer>
  19994.         <id>17</id>
  19995.         <text>p223</text>
  19996.     </content>
  19997.     <name></name>
  19998.     <script></script>
  19999. </card>
  20000.  
  20001.  
  20002. card_58255.xml
  20003. <?xml version="1.0" encoding="utf-8" ?>
  20004. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20005. <card>
  20006.     <id>58255</id>
  20007.     <filler1>0</filler1>
  20008.     <cantDelete> <false /> </cantDelete>
  20009.     <showPict> <true /> </showPict>
  20010.     <dontSearch> <false /> </dontSearch>
  20011.     <owner>4755</owner>
  20012.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20013.     <content>
  20014.         <layer>background</layer>
  20015.         <id>4</id>
  20016.         <text><span class="style3">mimicking the right-to-left action of the</span><span class="style4"> = </span><span class="style3">assignment operator).
  20017.  
  20018. It is important to distinguish among string constants, character arrays, and character pointers variables, all of which are treated as character pointers.  When a character pointer variable is declared, no space is yet allocated for a character array.  Therefore it is appropriate to use the</span><span class="style4"> = </span><span class="style3">assignment operator to assign to the pointer variable a pointer to a string, but it is unwise to use</span><span class="style4"> strcpy() </span><span class="style3">to assign to the unallocated portion of memory initially pointed to by the pointer variable.  On the other hand when a character array is declared, space is allocated for the array elements.  However, an array name is a constant pointer so it may not be assigned to.  Also, in ANSI C it is illegal to assign a new value to a string constant:
  20019. </span><span class="style4">
  20020.     char  *ptr1, ptr2[80], *ptr3;   // two character pointers and one array 
  20021.     ptr1 = "Hello, world!";         // ptr1 now points to the constant string 
  20022.     *(ptr1+7) = 'x';    // illegal!  Attempts to change 'w' in constant string
  20023.     ptr2 = "Hello, world!"; // illegal! ptr2 is pointer constant, not variable
  20024.     strcpy(ptr3,"Hello!");  // incorrect! Copies string to unallocated memory 
  20025. </span><span class="style3">
  20026. </span></text>
  20027.     </content>
  20028.     <content>
  20029.         <layer>background</layer>
  20030.         <id>7</id>
  20031.         <text>217</text>
  20032.     </content>
  20033.     <name></name>
  20034.     <script></script>
  20035. </card>
  20036.  
  20037.  
  20038. card_58593.xml
  20039. <?xml version="1.0" encoding="utf-8" ?>
  20040. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20041. <card>
  20042.     <id>58593</id>
  20043.     <filler1>0</filler1>
  20044.     <cantDelete> <false /> </cantDelete>
  20045.     <showPict> <true /> </showPict>
  20046.     <dontSearch> <false /> </dontSearch>
  20047.     <owner>4755</owner>
  20048.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20049.     <content>
  20050.         <layer>background</layer>
  20051.         <id>4</id>
  20052.         <text><span class="style3">nother frequently-used standard string function is </span><span class="style4">strlen()</span><span class="style3">, which returns the length of the string pointed to by its argument, not including the terminating null character.
  20053.  
  20054. The </span><span class="style4">strcmp()</span><span class="style3"> function accepts two character pointers as its arguments and returns either 0 if the strings pointed to are equal, a positive integer if the first string is greater than the second, or a negative integer if the second string is greater than the first.
  20055.  
  20056. The </span><span class="style4">strstr()</span><span class="style3"> function returns a pointer to the first occurrence of the string pointed to by its second argument within the string pointed to by its first argument (disregarding the null terminator of the second string) or the </span><span class="style4">NULL</span><span class="style3"> pointer if no match is found.
  20057.  
  20058. There are several other standard string functions for concatenating strings, converting strings of digits to integer or double values, etc.</span></text>
  20059.     </content>
  20060.     <content>
  20061.         <layer>background</layer>
  20062.         <id>7</id>
  20063.         <text>218</text>
  20064.     </content>
  20065.     <name></name>
  20066.     <script></script>
  20067. </card>
  20068.  
  20069.  
  20070. card_35106.xml
  20071. <?xml version="1.0" encoding="utf-8" ?>
  20072. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20073. <card>
  20074.     <id>35106</id>
  20075.     <filler1>0</filler1>
  20076.     <cantDelete> <false /> </cantDelete>
  20077.     <showPict> <true /> </showPict>
  20078.     <dontSearch> <false /> </dontSearch>
  20079.     <owner>4755</owner>
  20080.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20081.     <content>
  20082.         <layer>background</layer>
  20083.         <id>6</id>
  20084.         <text>8.4  Memory Management</text>
  20085.     </content>
  20086.     <content>
  20087.         <layer>background</layer>
  20088.         <id>7</id>
  20089.         <text>219</text>
  20090.     </content>
  20091.     <content>
  20092.         <layer>background</layer>
  20093.         <id>4</id>
  20094.         <text><span class="style3">ynamic memory management is frequently used in TC and C++ to allocate and deallocate objects.  </span><span class="style4">new</span><span class="style3"> and </span><span class="style4">delete</span><span class="style3"> are built-in operators which may be applied to object (or non-objects in C++ only) "free-store" variables.
  20095.  
  20096. The standard </span><span class="style4">malloc()</span><span class="style3"> and </span><span class="style4">free()</span><span class="style3"> functions may be used to dynamically allocate and deallocate non-objects (such as floats, character strings, or user-defined structures) in ANSI C.  (In truth, a third method is commonly used in Macintosh C programs:  non-portable calls to the Macintosh memory-management Toolbox routines via the MacTraps library.)  These functions are defined in the ANSI library and declared in </span><span class="style18">stdlib.h</span><span class="style3">.
  20097. </span><span class="style4">
  20098.     # include   <stdlib.h>
  20099.  
  20100. </span><span class="style3">The prototype for </span><span class="style4">malloc()</span><span class="style3"> is:
  20101. </span><span class="style4">
  20102.     void   *malloc(size_t num_of_bytes);</span></text>
  20103.     </content>
  20104.     <content>
  20105.         <layer>background</layer>
  20106.         <id>17</id>
  20107.         <text>p223</text>
  20108.     </content>
  20109.     <name></name>
  20110.     <script></script>
  20111. </card>
  20112.  
  20113.  
  20114. card_58754.xml
  20115. <?xml version="1.0" encoding="utf-8" ?>
  20116. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20117. <card>
  20118.     <id>58754</id>
  20119.     <filler1>0</filler1>
  20120.     <cantDelete> <false /> </cantDelete>
  20121.     <showPict> <true /> </showPict>
  20122.     <dontSearch> <false /> </dontSearch>
  20123.     <owner>4755</owner>
  20124.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20125.     <content>
  20126.         <layer>background</layer>
  20127.         <id>4</id>
  20128.         <text><span class="style3">he </span><span class="style4">size_t</span><span class="style3"> type is defined in </span><span class="style18">stdlib.h</span><span class="style3"> and is typically an unsigned long integer.  The </span><span class="style4">malloc()</span><span class="style3"> function returns a pointer to a block of memory of the desired size.  This is a </span><span class="style4">void</span><span class="style3"> pointer, meaning that it may be assigned to a pointer of any type.
  20129.  
  20130. The number of bytes required is frequently determined using the </span><span class="style4">sizeof</span><span class="style3"> operator, which evaluates the number of bytes required by its operand.  An example using the </span><span class="style4">personnel_rec</span><span class="style3"> user-defined type discussed earlier* is:
  20131. </span><span class="style4">
  20132.     # include   <stdlib.h>
  20133.                .
  20134.                .
  20135.         struct personnel_rec   *p_ptr;
  20136.         p_ptr = (struct personnel_rec*) malloc(sizeof (struct personnel_rec));
  20137.                .
  20138.                .
  20139.         free(p_ptr);
  20140.  
  20141. </span><span class="style3">The </span><span class="style4">free()</span><span class="style3"> function deallocates the space pointed to by its argument.</span></text>
  20142.     </content>
  20143.     <content>
  20144.         <layer>background</layer>
  20145.         <id>7</id>
  20146.         <text>220</text>
  20147.     </content>
  20148.     <content>
  20149.         <layer>background</layer>
  20150.         <id>29</id>
  20151.         <text>25150</text>
  20152.     </content>
  20153.     <content>
  20154.         <layer>background</layer>
  20155.         <id>27</id>
  20156.         <text>personnel_rec structure</text>
  20157.     </content>
  20158.     <content>
  20159.         <layer>background</layer>
  20160.         <id>20</id>
  20161.         <text>personnel_rec structure - p75</text>
  20162.     </content>
  20163.     <name></name>
  20164.     <script></script>
  20165. </card>
  20166.  
  20167.  
  20168. card_59075.xml
  20169. <?xml version="1.0" encoding="utf-8" ?>
  20170. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20171. <card>
  20172.     <id>59075</id>
  20173.     <filler1>0</filler1>
  20174.     <cantDelete> <false /> </cantDelete>
  20175.     <showPict> <true /> </showPict>
  20176.     <dontSearch> <false /> </dontSearch>
  20177.     <owner>4755</owner>
  20178.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20179.     <content>
  20180.         <layer>background</layer>
  20181.         <id>4</id>
  20182.         <text><span class="style3">ote that a cast operator* is used to convert the </span><span class="style4">void</span><span class="style3"> pointer returned by </span><span class="style4">malloc()</span><span class="style3"> to the desired type.  This is not strictly necessary since automatic type conversion will take place upon assignment.
  20183.  
  20184. Dynamic memory allocation is often used when the amount of memory needed by an application is not known before run-time.  The program may define a large array of pointers to data structures, but dynamically allocate the individual data structures pointed to by elements of the array only as needed:
  20185. </span><span class="style4">
  20186.     struct personnel_rec  *p_arr[1000];   // doesn't yet allocate any
  20187.                                           //    personnel_rec's
  20188.         .
  20189.         .
  20190.     p_arr[i] = malloc(sizeof (struct personnel_rec));  // allocate ith element
  20191.  
  20192. </span></text>
  20193.     </content>
  20194.     <content>
  20195.         <layer>background</layer>
  20196.         <id>7</id>
  20197.         <text>221</text>
  20198.     </content>
  20199.     <content>
  20200.         <layer>background</layer>
  20201.         <id>29</id>
  20202.         <text>47191</text>
  20203.     </content>
  20204.     <content>
  20205.         <layer>background</layer>
  20206.         <id>27</id>
  20207.         <text>Casts for type conversion</text>
  20208.     </content>
  20209.     <content>
  20210.         <layer>background</layer>
  20211.         <id>20</id>
  20212.         <text>Casts for type conversion - p175</text>
  20213.     </content>
  20214.     <name></name>
  20215.     <script></script>
  20216. </card>
  20217.  
  20218.  
  20219. card_23089.xml
  20220. <?xml version="1.0" encoding="utf-8" ?>
  20221. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20222. <card>
  20223.     <id>23089</id>
  20224.     <filler1>0</filler1>
  20225.     <cantDelete> <false /> </cantDelete>
  20226.     <showPict> <true /> </showPict>
  20227.     <dontSearch> <false /> </dontSearch>
  20228.     <owner>4755</owner>
  20229.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20230.     <content>
  20231.         <layer>background</layer>
  20232.         <id>6</id>
  20233.         <text>9.  Software Engineering</text>
  20234.     </content>
  20235.     <content>
  20236.         <layer>background</layer>
  20237.         <id>4</id>
  20238.         <text>A program's efficiency may be a measure of its raw processing speed.  However as both hardware performance and user expectations continue to rise rapidly, this sort of efficiency is subordinate to the efficiency of the overall software lifecycle.
  20239.  
  20240. Programmers naturally strive for efficiency by attempting to minimize the amount of future effort a program will generate.  This often involves tradeoffs among short-term and long-term investments by the programmer, and ease of use and flexibility from the user's perspective.
  20241.  
  20242. This chapter discusses programming issues related to code reusability, portability, and user-interface design in the context of TC and C++.  Code for potentially-portable 2-dimensional graphics and for a simple menu-driven application framework is included.
  20243. </text>
  20244.     </content>
  20245.     <content>
  20246.         <layer>background</layer>
  20247.         <id>7</id>
  20248.         <text>222</text>
  20249.     </content>
  20250.     <content>
  20251.         <layer>background</layer>
  20252.         <id>17</id>
  20253.         <text>p250</text>
  20254.     </content>
  20255.     <name></name>
  20256.     <script></script>
  20257. </card>
  20258.  
  20259.  
  20260. card_60165.xml
  20261. <?xml version="1.0" encoding="utf-8" ?>
  20262. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20263. <card>
  20264.     <id>60165</id>
  20265.     <filler1>0</filler1>
  20266.     <cantDelete> <false /> </cantDelete>
  20267.     <showPict> <true /> </showPict>
  20268.     <dontSearch> <false /> </dontSearch>
  20269.     <owner>4755</owner>
  20270.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20271.     <content>
  20272.         <layer>background</layer>
  20273.         <id>6</id>
  20274.         <text>9.1  Code Reusability</text>
  20275.     </content>
  20276.     <content>
  20277.         <layer>background</layer>
  20278.         <id>4</id>
  20279.         <text><span class="style3">he object-oriented programming (OOP) approach facilitated by Think C and C++ provides the potential for vast improvements in the </span><span class="style7">maintenance and reuse of source code</span><span class="style3">.  Code maintainability generally depends on how easily the source code can be adapted to changing user requirements.  This sort of code reuse differs only in degree from the use of portions of existing source code in entirely new programming efforts.
  20280.  
  20281. By encapsulating data with the procedures which act upon the data the programmer can construct modular applications, which encourage the reuse of data </span><span class="style7">objects</span><span class="style3"> (Chapter 4).  OOP languages like TC/C++ provide syntactical assistance for such encapsulation.  More importantly, they allow the definition of </span><span class="style7">classes</span><span class="style3"> of objects and the construction of </span><span class="style7">derived</span><span class="style3"> classes.  Since even the most modular code often requires customization for reuse in a new programming situation, the ability to easily construct new classes which </span><span class="style7">inherit</span><span class="style3"> the data structures and functionality of an existing class has great significance.
  20282.  
  20283. Applications should be constructed as a collection of interacting objects, each of </span></text>
  20284.     </content>
  20285.     <content>
  20286.         <layer>background</layer>
  20287.         <id>7</id>
  20288.         <text>223</text>
  20289.     </content>
  20290.     <name></name>
  20291.     <script></script>
  20292. </card>
  20293.  
  20294.  
  20295. card_61545.xml
  20296. <?xml version="1.0" encoding="utf-8" ?>
  20297. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20298. <card>
  20299.     <id>61545</id>
  20300.     <filler1>0</filler1>
  20301.     <cantDelete> <false /> </cantDelete>
  20302.     <showPict> <true /> </showPict>
  20303.     <dontSearch> <false /> </dontSearch>
  20304.     <owner>4755</owner>
  20305.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20306.     <content>
  20307.         <layer>background</layer>
  20308.         <id>4</id>
  20309.         <text><span class="style3">hich represents a data structure and its interface.  When an existing class must be altered significantly to obtain the desired functionality, the programmer should instead derive a new class.
  20310.  
  20311. On the other hand, the programmer should inspect the structure of any new class to determine whether a more general </span><span class="style7">abstract</span><span class="style3"> class (of which an object is never defined) can instead be defined.  The desired class may then be derived from the more general class, which itself has a greater likelyhood of reuse in future programming efforts.  This approach also helps simplify future maintentance of the application.
  20312.  
  20313. Abstract classes in turn may derive from still more general classes, to create a tree-shaped class hierarchy.  (The multiple inheritance property of C++ v.2.0 and later allows non-tree-shaped structures.)  Often all classes used in an application are derived from a single </span><span class="style7">root</span><span class="style3"> class, such as the Generic_Class used in the example in Chapter 4.  This simplifies changing certain basic characteristics which are common to all classes.
  20314.  
  20315. </span></text>
  20316.     </content>
  20317.     <content>
  20318.         <layer>background</layer>
  20319.         <id>7</id>
  20320.         <text>224</text>
  20321.     </content>
  20322.     <name></name>
  20323.     <script></script>
  20324. </card>
  20325.  
  20326.  
  20327. card_61949.xml
  20328. <?xml version="1.0" encoding="utf-8" ?>
  20329. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20330. <card>
  20331.     <id>61949</id>
  20332.     <filler1>0</filler1>
  20333.     <cantDelete> <false /> </cantDelete>
  20334.     <showPict> <true /> </showPict>
  20335.     <dontSearch> <false /> </dontSearch>
  20336.     <owner>4755</owner>
  20337.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20338.     <content>
  20339.         <layer>background</layer>
  20340.         <id>4</id>
  20341.         <text><span class="style3"> collection of related general-purpose classes may be organized to form a </span><span class="style7">class library</span><span class="style3">* for use in future programming efforts.  This sort of library may be distri- buted in precompiled modules rather than in the form of source code.  Interestingly, programmers may derive new classes from those supplied in such libraries without need for access to the proprietary source code.
  20342.  
  20343. </span></text>
  20344.     </content>
  20345.     <content>
  20346.         <layer>background</layer>
  20347.         <id>7</id>
  20348.         <text>225</text>
  20349.     </content>
  20350.     <content>
  20351.         <layer>background</layer>
  20352.         <id>29</id>
  20353.         <text>62767</text>
  20354.     </content>
  20355.     <content>
  20356.         <layer>background</layer>
  20357.         <id>27</id>
  20358.         <text>Class libraries</text>
  20359.     </content>
  20360.     <content>
  20361.         <layer>background</layer>
  20362.         <id>20</id>
  20363.         <text>Class libraries - p234</text>
  20364.     </content>
  20365.     <name></name>
  20366.     <script></script>
  20367. </card>
  20368.  
  20369.  
  20370. card_61284.xml
  20371. <?xml version="1.0" encoding="utf-8" ?>
  20372. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20373. <card>
  20374.     <id>61284</id>
  20375.     <filler1>0</filler1>
  20376.     <cantDelete> <false /> </cantDelete>
  20377.     <showPict> <true /> </showPict>
  20378.     <dontSearch> <false /> </dontSearch>
  20379.     <owner>4755</owner>
  20380.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20381.     <content>
  20382.         <layer>background</layer>
  20383.         <id>6</id>
  20384.         <text>9.2  Portability</text>
  20385.     </content>
  20386.     <content>
  20387.         <layer>background</layer>
  20388.         <id>4</id>
  20389.         <text><span class="style3">estriction to writing completely portable programs prevents the programmer from taking advantage of useful features specific to a single environment.  For example the Macintosh ROM "Toolbox" provides many invaluable routines for writing Macintosh programs.
  20390.  
  20391. It is often possible to confine non-portable code to individual program modules to allow reuse of the remaining code in other environments.  The example at the end of this section shows how to isolate non-portable graphics code by defining an abstract class from which machine-specific versions may be derived.  The particular object instantiated is selected to match the hardware needs.
  20392.  
  20393. A significant obstacle to portability results when targeting platforms using traditional command or menu-driven user interfaces and platforms using a Macintosh-style event-driven user interface.  The flow of control within software developed for the former type of interface is radically different from that in software developed for the latter.  It is anticipated that the study of </span><span class="style7">user interface management systems</span><span class="style3"> (UIMS) may lead to improved code reuse in such circumstances.
  20394.  
  20395.  
  20396. </span></text>
  20397.     </content>
  20398.     <content>
  20399.         <layer>background</layer>
  20400.         <id>7</id>
  20401.         <text>226</text>
  20402.     </content>
  20403.     <name></name>
  20404.     <script></script>
  20405. </card>
  20406.  
  20407.  
  20408. card_6548.xml
  20409. <?xml version="1.0" encoding="utf-8" ?>
  20410. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20411. <card>
  20412.     <id>6548</id>
  20413.     <filler1>0</filler1>
  20414.     <cantDelete> <false /> </cantDelete>
  20415.     <showPict> <true /> </showPict>
  20416.     <dontSearch> <false /> </dontSearch>
  20417.     <owner>4755</owner>
  20418.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20419.     <content>
  20420.         <layer>background</layer>
  20421.         <id>4</id>
  20422.         <text>A UIMS establishes an additional programming layer consisting of an abstract definition of the application's user interface.  The implementation of this abstract definition may be done in a variety of ways.  For example, a request for a selection by the user may be implemented via a command-line prompt or by polling a pointing device such as a mouse.  If all references to the user interface are made via the new programming layer, it becomes possible to vary the implementation of the user interface without altering the functional portion of the program.  That is, the application-specific portion of the program may be combined with any one of several existing user interface modules to produce a complete application with the desired user interface.  Changing the user interface requires only swapping user interface modules and recompiling.
  20423.  
  20424. Although general-purpose UIMS implementations have seen little commercial application to date, the underlying technique of abstracting the user interface is often incorporated into commercial applications to encourage portability.  The potential exists to extend portability beyond the consideration of alternative harware platforms, to encompass portability among alternative user interfaces as well.
  20425.  
  20426. </text>
  20427.     </content>
  20428.     <content>
  20429.         <layer>background</layer>
  20430.         <id>7</id>
  20431.         <text>227</text>
  20432.     </content>
  20433.     <name></name>
  20434.     <script></script>
  20435. </card>
  20436.  
  20437.  
  20438. card_66237.xml
  20439. <?xml version="1.0" encoding="utf-8" ?>
  20440. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20441. <card>
  20442.     <id>66237</id>
  20443.     <filler1>0</filler1>
  20444.     <cantDelete> <false /> </cantDelete>
  20445.     <showPict> <true /> </showPict>
  20446.     <dontSearch> <false /> </dontSearch>
  20447.     <owner>4755</owner>
  20448.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20449.     <content>
  20450.         <layer>background</layer>
  20451.         <id>4</id>
  20452.         <text><span class="style3">ORTABLE GRAPHICS
  20453.  
  20454. The files listed in the following pages implement the abstract Generic_SScreen ("simple screen") class for general-purpose 2-dimensional graphics combined with stdio-style output.  The Mac_SScreen class is derived from this class for use on the Macintosh, but versions for DOS or UNIX-based graphics environments may readily be derived as well.  Applications which use SScreen objects for graphics will then be portable to other environments.
  20455.  
  20456. The files </span><span class="style18">class.h</span><span class="style3"> and </span><span class="style18">class.c</span><span class="style3"> given in Chapter 4 are also required.  Think C's MacTraps library is required for applications using the Mac_SScreen class, in order to gain access to the Macintosh graphics routines.  Think C's "Prefix" option should contain "# include <MacHeaders>" in order to properly declare these graphics routines.
  20457.  
  20458. An example application is also included.
  20459.  
  20460. </span></text>
  20461.     </content>
  20462.     <content>
  20463.         <layer>background</layer>
  20464.         <id>7</id>
  20465.         <text>228</text>
  20466.     </content>
  20467.     <name></name>
  20468.     <script></script>
  20469. </card>
  20470.  
  20471.  
  20472. card_66370.xml
  20473. <?xml version="1.0" encoding="utf-8" ?>
  20474. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20475. <card>
  20476.     <id>66370</id>
  20477.     <filler1>0</filler1>
  20478.     <cantDelete> <false /> </cantDelete>
  20479.     <showPict> <true /> </showPict>
  20480.     <dontSearch> <false /> </dontSearch>
  20481.     <owner>4755</owner>
  20482.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20483.     <part>
  20484.         <id>1</id>
  20485.         <type>field</type>
  20486.         <visible> <true /> </visible>
  20487.         <dontWrap> <false /> </dontWrap>
  20488.         <dontSearch> <false /> </dontSearch>
  20489.         <sharedText> <false /> </sharedText>
  20490.         <fixedLineHeight> <true /> </fixedLineHeight>
  20491.         <autoTab> <false /> </autoTab>
  20492.         <lockText> <false /> </lockText>
  20493.         <rect>
  20494.             <left>30</left>
  20495.             <top>78</top>
  20496.             <right>478</right>
  20497.             <bottom>296</bottom>
  20498.         </rect>
  20499.         <style>scrolling</style>
  20500.         <autoSelect> <false /> </autoSelect>
  20501.         <showLines> <false /> </showLines>
  20502.         <wideMargins> <false /> </wideMargins>
  20503.         <multipleLines> <false /> </multipleLines>
  20504.         <reservedFamily> 0 </reservedFamily>
  20505.         <titleWidth>0</titleWidth>
  20506.         <icon>0</icon>
  20507.         <textAlign>left</textAlign>
  20508.         <font>Monaco</font>
  20509.         <textSize>9</textSize>
  20510.         <textStyle>plain</textStyle>
  20511.         <textHeight>12</textHeight>
  20512.         <name>code</name>
  20513.         <script></script>
  20514.     </part>
  20515.     <part>
  20516.         <id>2</id>
  20517.         <type>button</type>
  20518.         <visible> <true /> </visible>
  20519.         <reserved5> 0 </reserved5>
  20520.         <reserved4> 0 </reserved4>
  20521.         <reserved3> 0 </reserved3>
  20522.         <reserved2> 0 </reserved2>
  20523.         <reserved1> 0 </reserved1>
  20524.         <enabled> <true /> </enabled>
  20525.         <rect>
  20526.             <left>13</left>
  20527.             <top>29</top>
  20528.             <right>351</right>
  20529.             <bottom>57</bottom>
  20530.         </rect>
  20531.         <style>opaque</style>
  20532.         <showName> <false /> </showName>
  20533.         <highlight> <false /> </highlight>
  20534.         <autoHighlight> <false /> </autoHighlight>
  20535.         <sharedHighlight> <true /> </sharedHighlight>
  20536.         <family>0</family>
  20537.         <titleWidth>0</titleWidth>
  20538.         <icon>0</icon>
  20539.         <textAlign>center</textAlign>
  20540.         <font>Chicago</font>
  20541.         <textSize>12</textSize>
  20542.         <textStyle>plain</textStyle>
  20543.         <name>New Button</name>
  20544.         <script></script>
  20545.     </part>
  20546.     <part>
  20547.         <id>3</id>
  20548.         <type>button</type>
  20549.         <visible> <true /> </visible>
  20550.         <reserved5> 0 </reserved5>
  20551.         <reserved4> 0 </reserved4>
  20552.         <reserved3> 0 </reserved3>
  20553.         <reserved2> 0 </reserved2>
  20554.         <reserved1> 0 </reserved1>
  20555.         <enabled> <true /> </enabled>
  20556.         <rect>
  20557.             <left>169</left>
  20558.             <top>32</top>
  20559.             <right>305</right>
  20560.             <bottom>54</bottom>
  20561.         </rect>
  20562.         <style>roundrect</style>
  20563.         <showName> <true /> </showName>
  20564.         <highlight> <false /> </highlight>
  20565.         <autoHighlight> <true /> </autoHighlight>
  20566.         <sharedHighlight> <true /> </sharedHighlight>
  20567.         <family>0</family>
  20568.         <titleWidth>0</titleWidth>
  20569.         <icon>0</icon>
  20570.         <textAlign>center</textAlign>
  20571.         <font>Chicago</font>
  20572.         <textSize>12</textSize>
  20573.         <textStyle>plain</textStyle>
  20574.         <name>Copy to Clipboard</name>
  20575.         <script>on mouseUp
  20576. set lockscreen to true
  20577. select text of card field "code"
  20578. domenu "Copy Text"
  20579. select empty
  20580. set lockscreen to false
  20581. end mouseUp</script>
  20582.     </part>
  20583.     <content>
  20584.         <layer>background</layer>
  20585.         <id>7</id>
  20586.         <text>229</text>
  20587.     </content>
  20588.     <content>
  20589.         <layer>background</layer>
  20590.         <id>4</id>
  20591.         <text>File 1 of 5.  A TC/C++ class for 2-dimensional graphics:
  20592.  
  20593.  
  20594.  
  20595.  
  20596.  
  20597.  
  20598.  
  20599.  
  20600.  
  20601.  
  20602.  
  20603. </text>
  20604.     </content>
  20605.     <content>
  20606.         <layer>background</layer>
  20607.         <id>6</id>
  20608.         <text>Portable 2-D graphics</text>
  20609.     </content>
  20610.     <content>
  20611.         <layer>card</layer>
  20612.         <id>1</id>
  20613.         <text>/*
  20614. *   FILE:     sscreen.h
  20615. *   AUTHOR:   R. Gonzalez
  20616. *   CREATED:  Feb. 12, 1992
  20617. *
  20618. *   Definition of Generic_SScreen class, to isolate graphics
  20619. *   code.  This assumes a console window for stdio I/O and
  20620. *   a graphics window using a user-defined view coordinate
  20621. *   system.  The view_width and view_height instance variables
  20622. *   define the width and height of the desired coordinate
  20623. *   system, and view_x and view_y are the desired location
  20624. *   of the origin with respect to the lower left-hand corner.
  20625. *   The transform_x() and transform_y() methods
  20626. *   translate into screen coordinates for use by machine
  20627. *   -dependent drawing routines.
  20628. */
  20629.  
  20630. # ifndef sscreen_h
  20631. # define sscreen_h
  20632.  
  20633. # include "class.h"
  20634.  
  20635. # define   BLACK      0
  20636. # define   WHITE      1
  20637. # define   RED        2
  20638. # define   YELLOW     3
  20639. # define   GREEN      4
  20640. # define   BLUE       5
  20641. # define   CYAN       6
  20642. # define   MAGENTA    7
  20643.  
  20644. # define   BACKGROUND BLACK
  20645.  
  20646. /******************************************************************
  20647. *   abstract class to isolate graphics I/O
  20648. ******************************************************************/
  20649. class   Generic_SScreen:public Generic_Class
  20650. {
  20651. protected:
  20652.     int     screen_width,
  20653.             screen_height,
  20654.             present_color;
  20655.     double  view_width,
  20656.             view_height,
  20657.             view_x,
  20658.             view_y;
  20659.     int     transform_x(double);
  20660.     int     transform_y(double);
  20661.  
  20662. public:
  20663.     Generic_SScreen(void);
  20664.     virtual void    graphics_to_front(void);
  20665.     virtual void    console_to_front(void);
  20666.     double          get_aspect_ratio(void);
  20667.     void            set_view(double,double,double,double);
  20668.     virtual void    cursor_on(void);
  20669.     virtual void    cursor_off(void);
  20670.     virtual void    set_color(int);
  20671.     virtual void    erase_graphics(void);
  20672.     void            draw_line(double,double,double,double);
  20673.     virtual void    move_to(double,double);
  20674.     virtual void    draw_to(double,double);
  20675.     virtual void    draw_circle(double,double,double);
  20676.     virtual void    fill_circle(double,double,double);
  20677.     virtual boolean mouse_button_is_down(void);
  20678.     virtual void    get_mouse_location(double*,double*);
  20679.     void            wait(void);
  20680. };
  20681.  
  20682. # endif
  20683. </text>
  20684.     </content>
  20685.     <name></name>
  20686.     <script></script>
  20687. </card>
  20688.  
  20689.  
  20690. card_67502.xml
  20691. <?xml version="1.0" encoding="utf-8" ?>
  20692. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  20693. <card>
  20694.     <id>67502</id>
  20695.     <filler1>0</filler1>
  20696.     <cantDelete> <false /> </cantDelete>
  20697.     <showPict> <true /> </showPict>
  20698.     <dontSearch> <false /> </dontSearch>
  20699.     <owner>4755</owner>
  20700.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  20701.     <part>
  20702.         <id>1</id>
  20703.         <type>field</type>
  20704.         <visible> <true /> </visible>
  20705.         <dontWrap> <false /> </dontWrap>
  20706.         <dontSearch> <false /> </dontSearch>
  20707.         <sharedText> <false /> </sharedText>
  20708.         <fixedLineHeight> <true /> </fixedLineHeight>
  20709.         <autoTab> <false /> </autoTab>
  20710.         <lockText> <false /> </lockText>
  20711.         <rect>
  20712.             <left>30</left>
  20713.             <top>78</top>
  20714.             <right>478</right>
  20715.             <bottom>296</bottom>
  20716.         </rect>
  20717.         <style>scrolling</style>
  20718.         <autoSelect> <false /> </autoSelect>
  20719.         <showLines> <false /> </showLines>
  20720.         <wideMargins> <false /> </wideMargins>
  20721.         <multipleLines> <false /> </multipleLines>
  20722.         <reservedFamily> 0 </reservedFamily>
  20723.         <titleWidth>0</titleWidth>
  20724.         <icon>0</icon>
  20725.         <textAlign>left</textAlign>
  20726.         <font>Monaco</font>
  20727.         <textSize>9</textSize>
  20728.         <textStyle>plain</textStyle>
  20729.         <textHeight>12</textHeight>
  20730.         <name>code</name>
  20731.         <script></script>
  20732.     </part>
  20733.     <part>
  20734.         <id>2</id>
  20735.         <type>button</type>
  20736.         <visible> <true /> </visible>
  20737.         <reserved5> 0 </reserved5>
  20738.         <reserved4> 0 </reserved4>
  20739.         <reserved3> 0 </reserved3>
  20740.         <reserved2> 0 </reserved2>
  20741.         <reserved1> 0 </reserved1>
  20742.         <enabled> <true /> </enabled>
  20743.         <rect>
  20744.             <left>13</left>
  20745.             <top>29</top>
  20746.             <right>351</right>
  20747.             <bottom>57</bottom>
  20748.         </rect>
  20749.         <style>opaque</style>
  20750.         <showName> <false /> </showName>
  20751.         <highlight> <false /> </highlight>
  20752.         <autoHighlight> <false /> </autoHighlight>
  20753.         <sharedHighlight> <true /> </sharedHighlight>
  20754.         <family>0</family>
  20755.         <titleWidth>0</titleWidth>
  20756.         <icon>0</icon>
  20757.         <textAlign>center</textAlign>
  20758.         <font>Chicago</font>
  20759.         <textSize>12</textSize>
  20760.         <textStyle>plain</textStyle>
  20761.         <name>New Button</name>
  20762.         <script></script>
  20763.     </part>
  20764.     <part>
  20765.         <id>3</id>
  20766.         <type>button</type>
  20767.         <visible> <true /> </visible>
  20768.         <reserved5> 0 </reserved5>
  20769.         <reserved4> 0 </reserved4>
  20770.         <reserved3> 0 </reserved3>
  20771.         <reserved2> 0 </reserved2>
  20772.         <reserved1> 0 </reserved1>
  20773.         <enabled> <true /> </enabled>
  20774.         <rect>
  20775.             <left>169</left>
  20776.             <top>32</top>
  20777.             <right>305</right>
  20778.             <bottom>54</bottom>
  20779.         </rect>
  20780.         <style>roundrect</style>
  20781.         <showName> <true /> </showName>
  20782.         <highlight> <false /> </highlight>
  20783.         <autoHighlight> <true /> </autoHighlight>
  20784.         <sharedHighlight> <true /> </sharedHighlight>
  20785.         <family>0</family>
  20786.         <titleWidth>0</titleWidth>
  20787.         <icon>0</icon>
  20788.         <textAlign>center</textAlign>
  20789.         <font>Chicago</font>
  20790.         <textSize>12</textSize>
  20791.         <textStyle>plain</textStyle>
  20792.         <name>Copy to Clipboard</name>
  20793.         <script>on mouseUp
  20794. set lockscreen to true
  20795. select text of card field "code"
  20796. domenu "Copy Text"
  20797. select empty
  20798. set lockscreen to false
  20799. end mouseUp</script>
  20800.     </part>
  20801.     <content>
  20802.         <layer>background</layer>
  20803.         <id>7</id>
  20804.         <text>230</text>
  20805.     </content>
  20806.     <content>
  20807.         <layer>background</layer>
  20808.         <id>4</id>
  20809.         <text>File 2 of 5.
  20810.  
  20811.  
  20812.  
  20813.  
  20814.  
  20815.  
  20816.  
  20817.  
  20818.  
  20819.  
  20820.  
  20821. </text>
  20822.     </content>
  20823.     <content>
  20824.         <layer>background</layer>
  20825.         <id>6</id>
  20826.         <text>Application framework, database example</text>
  20827.     </content>
  20828.     <content>
  20829.         <layer>card</layer>
  20830.         <id>1</id>
  20831.         <text>/*
  20832. *   FILE:     sscreen.c
  20833. *   AUTHOR:   R. Gonzalez
  20834. *   CREATED:  Feb. 12, 1992
  20835. *
  20836. *   Generic graphics routines to supplement a typical stdio-type
  20837. *   application with a graphics window.  The actual graphics 
  20838. *   functionality is up to platform-dependent derived classes,
  20839. *   such as Mac_SScreen.
  20840. */
  20841.  
  20842. # include   "sscreen.h"
  20843.  
  20844. /******************************************************************
  20845. *   Transform view coordinate x to screen coordinates
  20846. ******************************************************************/
  20847. int   Generic_SScreen::transform_x(double x)
  20848. {
  20849.     return (int) ((x+view_x)*(double) screen_width/view_width);
  20850. }
  20851.  
  20852. /******************************************************************
  20853. *   Transform view coordinate y to screen coordinates
  20854. ******************************************************************/
  20855. int   Generic_SScreen::transform_y(double y)
  20856. {
  20857.     return (int) ((view_height-view_y-y) *
  20858.            (double) screen_height/view_height);
  20859. }
  20860.  
  20861. /******************************************************************
  20862. *   Initialize screen.  Derived class may change default view
  20863. *    coordinate system to match actual aspect ratio.
  20864. ******************************************************************/
  20865. Generic_SScreen::Generic_SScreen(void)
  20866. {
  20867.     set_view(2.,2.,1.,1.);
  20868. }
  20869.  
  20870. /******************************************************************
  20871. *   Bring graphics to front.  This is up to the derived class.
  20872. ******************************************************************/
  20873. void   Generic_SScreen::graphics_to_front(void)
  20874. {
  20875. }
  20876.  
  20877. /******************************************************************
  20878. *   Bring console to front  This is up to the derived class.
  20879. ******************************************************************/
  20880. void   Generic_SScreen::console_to_front(void)
  20881. {
  20882. }
  20883.  
  20884. /******************************************************************
  20885. *   Return screen aspect ratio: width/height.  Make sure these
  20886. *   values have already been set!
  20887. ******************************************************************/
  20888. double   Generic_SScreen::get_aspect_ratio(void)
  20889. {
  20890.     return (double) screen_width/(double) screen_height;
  20891. }
  20892.  
  20893. /******************************************************************
  20894. *   Change view coordinate system for draw_line(), draw_circle(),
  20895. *   etc.  This is in terms of the view width, height, and origin of
  20896. *   the desired graphics window.  In terms of screen coordinates
  20897. *   the graphics window uses the whole screen.
  20898. ******************************************************************/
  20899. void   Generic_SScreen::set_view(double width,double height,
  20900.        double x,double y)
  20901. {
  20902.     view_width = width;
  20903.     view_height = height;
  20904.     view_x = x;
  20905.     view_y = y;
  20906. }
  20907.  
  20908. /******************************************************************
  20909. *   Turn cursor on.  This is up to the derived class.
  20910. ******************************************************************/
  20911. void   Generic_SScreen::cursor_on(void)
  20912. {
  20913. }
  20914.  
  20915. /******************************************************************
  20916. *   Turn cursor off.  This is up to the derived class.
  20917. ******************************************************************/
  20918. void   Generic_SScreen::cursor_off(void)
  20919. {
  20920. }
  20921.  
  20922. /******************************************************************
  20923. *   Sets the current drawing color.  Overriding method should
  20924. *   set color of drawing pen and call inherited method.
  20925. ******************************************************************/
  20926. void   Generic_SScreen::set_color(int x)
  20927. {
  20928.     present_color = x;
  20929. }
  20930.  
  20931. /******************************************************************
  20932. *   Sets graphics window to background color.  Up to derived class. 
  20933. ******************************************************************/
  20934. void   Generic_SScreen::erase_graphics(void)
  20935. {
  20936. }
  20937.  
  20938. /******************************************************************
  20939. *   draw_line() is used to draw lines using view coordinates.
  20940. ******************************************************************/
  20941. void   Generic_SScreen::draw_line(double x1,double y1,
  20942.        double x2,double y2)
  20943. {
  20944.     move_to(x1,y1);
  20945.     draw_to(x2,y2);
  20946. }
  20947.  
  20948. /******************************************************************
  20949. *   Move present pen position to new position using view
  20950. *   coordinates.  Nothing is drawn.  Derived class should use
  20951. *   transform_x() and transform_y() to convert to screen coords.
  20952. ******************************************************************/
  20953. void   Generic_SScreen::move_to(double x,double y)
  20954. {
  20955. }
  20956.  
  20957. /******************************************************************
  20958. *   Draw from present pen position to new position using view
  20959. *   coordinates.  Derived class should use transform_x() and
  20960. *   transform_y() to convert to screen coordinates.
  20961. ******************************************************************/
  20962. void   Generic_SScreen::draw_to(double x,double y)
  20963. {
  20964. }
  20965.  
  20966. /******************************************************************
  20967. *   draw_circle() draws a circle using view coordinates.  Derived
  20968. *   class should use transform_x() and transform_y() to convert to
  20969. *   screen coordinates.
  20970. ******************************************************************/
  20971. void   Generic_SScreen::draw_circle(double x,double y,double r)
  20972. {
  20973. }
  20974.  
  20975. /******************************************************************
  20976. *   fill_circle() draws a circle using view coordinates.  The
  20977. *   circle is filled with the present pen color.  Derived class
  20978. *   should use transform_x() and transform_y() to convert to screen
  20979. *   coordinates.
  20980. ******************************************************************/
  20981. void   Generic_SScreen::fill_circle(double x,double y,double r)
  20982. {
  20983. }
  20984.  
  20985. /******************************************************************
  20986. *  mouse_button_is_down() checks whether the mouse button is down,
  20987. *  returns TRUE if so, FALSE if not.  Up to derived class.  Make
  20988. *  sure to override this if you use Screen::wait(), or override
  20989. *  Screen::wait().  (Else you'll get an infinite "wait"!)
  20990. ******************************************************************/
  20991. boolean   Generic_SScreen::mouse_button_is_down(void)
  20992. {
  20993.     return FALSE;
  20994. }
  20995.  
  20996. /******************************************************************
  20997. *   get_mouse_location() returns the mouse coordinates (via its
  20998. *   arguments) in terms of the view coordinate system.  Derived
  20999. *   class must get the screen coords of the mouse, and use the in-
  21000. *   verse transformation of that in transform_x() and transform_y().
  21001. ******************************************************************/
  21002. void   Generic_SScreen::get_mouse_location(double *x_ptr,
  21003.        double *y_ptr)
  21004. {
  21005. }
  21006.  
  21007. /******************************************************************
  21008. *   Wait until button is pressed.
  21009. ******************************************************************/
  21010. void   Generic_SScreen::wait(void)
  21011. {
  21012.     while (!mouse_button_is_down())
  21013.         ;
  21014.     while (mouse_button_is_down())
  21015.         ;
  21016. }
  21017. </text>
  21018.     </content>
  21019.     <name></name>
  21020.     <script></script>
  21021. </card>
  21022.  
  21023.  
  21024. card_68808.xml
  21025. <?xml version="1.0" encoding="utf-8" ?>
  21026. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  21027. <card>
  21028.     <id>68808</id>
  21029.     <filler1>0</filler1>
  21030.     <cantDelete> <false /> </cantDelete>
  21031.     <showPict> <true /> </showPict>
  21032.     <dontSearch> <false /> </dontSearch>
  21033.     <owner>4755</owner>
  21034.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  21035.     <part>
  21036.         <id>1</id>
  21037.         <type>field</type>
  21038.         <visible> <true /> </visible>
  21039.         <dontWrap> <false /> </dontWrap>
  21040.         <dontSearch> <false /> </dontSearch>
  21041.         <sharedText> <false /> </sharedText>
  21042.         <fixedLineHeight> <true /> </fixedLineHeight>
  21043.         <autoTab> <false /> </autoTab>
  21044.         <lockText> <false /> </lockText>
  21045.         <rect>
  21046.             <left>30</left>
  21047.             <top>78</top>
  21048.             <right>478</right>
  21049.             <bottom>296</bottom>
  21050.         </rect>
  21051.         <style>scrolling</style>
  21052.         <autoSelect> <false /> </autoSelect>
  21053.         <showLines> <false /> </showLines>
  21054.         <wideMargins> <false /> </wideMargins>
  21055.         <multipleLines> <false /> </multipleLines>
  21056.         <reservedFamily> 0 </reservedFamily>
  21057.         <titleWidth>0</titleWidth>
  21058.         <icon>0</icon>
  21059.         <textAlign>left</textAlign>
  21060.         <font>Monaco</font>
  21061.         <textSize>9</textSize>
  21062.         <textStyle>plain</textStyle>
  21063.         <textHeight>12</textHeight>
  21064.         <name>code</name>
  21065.         <script></script>
  21066.     </part>
  21067.     <part>
  21068.         <id>2</id>
  21069.         <type>button</type>
  21070.         <visible> <true /> </visible>
  21071.         <reserved5> 0 </reserved5>
  21072.         <reserved4> 0 </reserved4>
  21073.         <reserved3> 0 </reserved3>
  21074.         <reserved2> 0 </reserved2>
  21075.         <reserved1> 0 </reserved1>
  21076.         <enabled> <true /> </enabled>
  21077.         <rect>
  21078.             <left>13</left>
  21079.             <top>29</top>
  21080.             <right>351</right>
  21081.             <bottom>57</bottom>
  21082.         </rect>
  21083.         <style>opaque</style>
  21084.         <showName> <false /> </showName>
  21085.         <highlight> <false /> </highlight>
  21086.         <autoHighlight> <false /> </autoHighlight>
  21087.         <sharedHighlight> <true /> </sharedHighlight>
  21088.         <family>0</family>
  21089.         <titleWidth>0</titleWidth>
  21090.         <icon>0</icon>
  21091.         <textAlign>center</textAlign>
  21092.         <font>Chicago</font>
  21093.         <textSize>12</textSize>
  21094.         <textStyle>plain</textStyle>
  21095.         <name>New Button</name>
  21096.         <script></script>
  21097.     </part>
  21098.     <part>
  21099.         <id>3</id>
  21100.         <type>button</type>
  21101.         <visible> <true /> </visible>
  21102.         <reserved5> 0 </reserved5>
  21103.         <reserved4> 0 </reserved4>
  21104.         <reserved3> 0 </reserved3>
  21105.         <reserved2> 0 </reserved2>
  21106.         <reserved1> 0 </reserved1>
  21107.         <enabled> <true /> </enabled>
  21108.         <rect>
  21109.             <left>169</left>
  21110.             <top>32</top>
  21111.             <right>305</right>
  21112.             <bottom>54</bottom>
  21113.         </rect>
  21114.         <style>roundrect</style>
  21115.         <showName> <true /> </showName>
  21116.         <highlight> <false /> </highlight>
  21117.         <autoHighlight> <true /> </autoHighlight>
  21118.         <sharedHighlight> <true /> </sharedHighlight>
  21119.         <family>0</family>
  21120.         <titleWidth>0</titleWidth>
  21121.         <icon>0</icon>
  21122.         <textAlign>center</textAlign>
  21123.         <font>Chicago</font>
  21124.         <textSize>12</textSize>
  21125.         <textStyle>plain</textStyle>
  21126.         <name>Copy to Clipboard</name>
  21127.         <script>on mouseUp
  21128. set lockscreen to true
  21129. select text of card field "code"
  21130. domenu "Copy Text"
  21131. select empty
  21132. set lockscreen to false
  21133. end mouseUp</script>
  21134.     </part>
  21135.     <content>
  21136.         <layer>background</layer>
  21137.         <id>7</id>
  21138.         <text>231</text>
  21139.     </content>
  21140.     <content>
  21141.         <layer>background</layer>
  21142.         <id>4</id>
  21143.         <text>File3 of 5.
  21144.  
  21145.  
  21146.  
  21147.  
  21148.  
  21149.  
  21150.  
  21151.  
  21152.  
  21153.  
  21154.  
  21155. </text>
  21156.     </content>
  21157.     <content>
  21158.         <layer>background</layer>
  21159.         <id>6</id>
  21160.         <text>Application framework, database example</text>
  21161.     </content>
  21162.     <content>
  21163.         <layer>card</layer>
  21164.         <id>1</id>
  21165.         <text>/*
  21166. *   FILE:     msscreen.h
  21167. *   AUTHOR:   R. Gonzalez
  21168. *   CREATED:  Feb. 12, 1992
  21169. *
  21170. *   Definition of Mac_SScreen class, a Macintosh-specific
  21171. *   derivative of Generic_SScreen.
  21172. */
  21173.  
  21174. # ifndef msscreen_h
  21175. # define msscreen_h
  21176.  
  21177. # include "sscreen.h"
  21178.  
  21179. /******************************************************************
  21180. *   Mac_Screen class to allow graphics I/O on Macintosh computers.
  21181. *   WindowPtr is declared in MacHeaders.
  21182. ******************************************************************/
  21183. class   Mac_SScreen:public Generic_SScreen
  21184. {
  21185. private:
  21186.     WindowPtr   graphics_window,
  21187.                 console_window;
  21188.     CursHandle  CrossCursor;
  21189.  
  21190. public:
  21191.     Mac_SScreen(void);
  21192.     virtual void    graphics_to_front(void);
  21193.     virtual void    console_to_front(void);
  21194.     virtual void    cursor_on(void);
  21195.     virtual void    cursor_off(void);
  21196.     virtual void    set_color(int);
  21197.     virtual void    erase_graphics(void);
  21198.     virtual void    move_to(double,double);
  21199.     virtual void    draw_to(double,double);
  21200.     virtual void    draw_circle(double,double,double);
  21201.     virtual void    fill_circle(double,double,double);
  21202.     virtual boolean mouse_button_is_down(void);
  21203.     virtual void    get_mouse_location(double*,double*);
  21204. };
  21205.  
  21206. # endif
  21207. </text>
  21208.     </content>
  21209.     <name></name>
  21210.     <script></script>
  21211. </card>
  21212.  
  21213.  
  21214. card_67305.xml
  21215. <?xml version="1.0" encoding="utf-8" ?>
  21216. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  21217. <card>
  21218.     <id>67305</id>
  21219.     <filler1>0</filler1>
  21220.     <cantDelete> <false /> </cantDelete>
  21221.     <showPict> <true /> </showPict>
  21222.     <dontSearch> <false /> </dontSearch>
  21223.     <owner>4755</owner>
  21224.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  21225.     <part>
  21226.         <id>1</id>
  21227.         <type>field</type>
  21228.         <visible> <true /> </visible>
  21229.         <dontWrap> <false /> </dontWrap>
  21230.         <dontSearch> <false /> </dontSearch>
  21231.         <sharedText> <false /> </sharedText>
  21232.         <fixedLineHeight> <true /> </fixedLineHeight>
  21233.         <autoTab> <false /> </autoTab>
  21234.         <lockText> <false /> </lockText>
  21235.         <rect>
  21236.             <left>30</left>
  21237.             <top>78</top>
  21238.             <right>478</right>
  21239.             <bottom>296</bottom>
  21240.         </rect>
  21241.         <style>scrolling</style>
  21242.         <autoSelect> <false /> </autoSelect>
  21243.         <showLines> <false /> </showLines>
  21244.         <wideMargins> <false /> </wideMargins>
  21245.         <multipleLines> <false /> </multipleLines>
  21246.         <reservedFamily> 0 </reservedFamily>
  21247.         <titleWidth>0</titleWidth>
  21248.         <icon>0</icon>
  21249.         <textAlign>left</textAlign>
  21250.         <font>Monaco</font>
  21251.         <textSize>9</textSize>
  21252.         <textStyle>plain</textStyle>
  21253.         <textHeight>12</textHeight>
  21254.         <name>code</name>
  21255.         <script></script>
  21256.     </part>
  21257.     <part>
  21258.         <id>2</id>
  21259.         <type>button</type>
  21260.         <visible> <true /> </visible>
  21261.         <reserved5> 0 </reserved5>
  21262.         <reserved4> 0 </reserved4>
  21263.         <reserved3> 0 </reserved3>
  21264.         <reserved2> 0 </reserved2>
  21265.         <reserved1> 0 </reserved1>
  21266.         <enabled> <true /> </enabled>
  21267.         <rect>
  21268.             <left>13</left>
  21269.             <top>29</top>
  21270.             <right>351</right>
  21271.             <bottom>57</bottom>
  21272.         </rect>
  21273.         <style>opaque</style>
  21274.         <showName> <false /> </showName>
  21275.         <highlight> <false /> </highlight>
  21276.         <autoHighlight> <false /> </autoHighlight>
  21277.         <sharedHighlight> <true /> </sharedHighlight>
  21278.         <family>0</family>
  21279.         <titleWidth>0</titleWidth>
  21280.         <icon>0</icon>
  21281.         <textAlign>center</textAlign>
  21282.         <font>Chicago</font>
  21283.         <textSize>12</textSize>
  21284.         <textStyle>plain</textStyle>
  21285.         <name>New Button</name>
  21286.         <script></script>
  21287.     </part>
  21288.     <part>
  21289.         <id>3</id>
  21290.         <type>button</type>
  21291.         <visible> <true /> </visible>
  21292.         <reserved5> 0 </reserved5>
  21293.         <reserved4> 0 </reserved4>
  21294.         <reserved3> 0 </reserved3>
  21295.         <reserved2> 0 </reserved2>
  21296.         <reserved1> 0 </reserved1>
  21297.         <enabled> <true /> </enabled>
  21298.         <rect>
  21299.             <left>169</left>
  21300.             <top>32</top>
  21301.             <right>305</right>
  21302.             <bottom>54</bottom>
  21303.         </rect>
  21304.         <style>roundrect</style>
  21305.         <showName> <true /> </showName>
  21306.         <highlight> <false /> </highlight>
  21307.         <autoHighlight> <true /> </autoHighlight>
  21308.         <sharedHighlight> <true /> </sharedHighlight>
  21309.         <family>0</family>
  21310.         <titleWidth>0</titleWidth>
  21311.         <icon>0</icon>
  21312.         <textAlign>center</textAlign>
  21313.         <font>Chicago</font>
  21314.         <textSize>12</textSize>
  21315.         <textStyle>plain</textStyle>
  21316.         <name>Copy to Clipboard</name>
  21317.         <script>on mouseUp
  21318. set lockscreen to true
  21319. select text of card field "code"
  21320. domenu "Copy Text"
  21321. select empty
  21322. set lockscreen to false
  21323. end mouseUp</script>
  21324.     </part>
  21325.     <content>
  21326.         <layer>background</layer>
  21327.         <id>7</id>
  21328.         <text>232</text>
  21329.     </content>
  21330.     <content>
  21331.         <layer>background</layer>
  21332.         <id>4</id>
  21333.         <text>File 4 of 5.
  21334.  
  21335.  
  21336.  
  21337.  
  21338.  
  21339.  
  21340.  
  21341.  
  21342.  
  21343.  
  21344.  
  21345. </text>
  21346.     </content>
  21347.     <content>
  21348.         <layer>background</layer>
  21349.         <id>6</id>
  21350.         <text>Application framework, database example</text>
  21351.     </content>
  21352.     <content>
  21353.         <layer>card</layer>
  21354.         <id>1</id>
  21355.         <text>/*
  21356. *   FILE:     msscreen.c
  21357. *   AUTHOR:   R. Gonzalez
  21358. *   CREATED:  Feb. 12, 1992
  21359. *
  21360. *   Mac-specific graphics routines to supplement
  21361. *   a typical stdio-type application with a graphics window.  The
  21362. *   Macintosh Toolbox is a set of routines in ROM which produce the
  21363. *   graphical user interface.  These Toolbox functions are declared in
  21364. *   MacHeaders.  They are distinguished from my own functions by
  21365. *   beginning with a capital letter.
  21366. *
  21367. *   Think C produces the "generic" console environment when a stdio
  21368. *   function call appears before the standard Toolbox initializations.
  21369. *   This appears to allow both input and output in the console window.
  21370. *   The console comes to the front automatically when written to.
  21371. *   This approach requires SelectWindow or BringToFront be used to
  21372. *   bring the graphics window to the front.  These routines do this
  21373. *   each time a line or circle is drawn, automatically reactivating
  21374. *   the graphics window.  They also will do an erase_graphics()
  21375. *   because the console will wash out the previous contents of the
  21376. *   graphics window.
  21377. */
  21378.  
  21379. # include   "msscreen.h"
  21380. # include   <stdio.h>
  21381. # include   <math.h>
  21382.  
  21383. # define   NIL_POINTER        0L
  21384. # define   MOVE_TO_FRONT      -1L
  21385. # define   REMOVE_ALL_EVENTS  0
  21386. # define   TITLE              "\pGraphics"
  21387. # define   VISIBLE            1
  21388. # define   NO_GO_AWAY         0
  21389. # define   NIL_REF_CON        NIL_POINTER
  21390.  
  21391. /******************************************************************
  21392. *   Likely don't need all these initializations; most are taken
  21393. *   from Mark & Reed's "Macintosh Programming Primer",
  21394. *   Addison-Wesley, 1989
  21395. ******************************************************************/
  21396. Mac_SScreen::Mac_SScreen(void)
  21397. {
  21398.     double  aspect;
  21399.  
  21400. //  Need a stdio function call to produce the generic console
  21401. //  environment BEFORE the remaining inits:
  21402.  
  21403.     printf("\n");
  21404.     console_window = FrontWindow();
  21405.  
  21406.     InitGraf(&thePort);
  21407.     InitFonts();
  21408.     FlushEvents(everyEvent,REMOVE_ALL_EVENTS);
  21409.  
  21410. //  Commented out InitWindows to preserve the menu bar.
  21411. //  May be dangerous?
  21412.  
  21413. //  InitWindows();
  21414.     InitMenus();
  21415.     TEInit();
  21416.     InitDialogs(NIL_POINTER);
  21417.     InitCursor();
  21418.     CrossCursor = GetCursor(crossCursor);
  21419.     HideCursor();
  21420.  
  21421.     graphics_window = NewWindow(NIL_POINTER,&(screenBits.bounds),
  21422.         TITLE,VISIBLE,plainDBox,(WindowPtr) MOVE_TO_FRONT,
  21423.         NO_GO_AWAY,NIL_REF_CON);
  21424.     SetPort(graphics_window);
  21425.     screen_width = graphics_window->portRect.right -
  21426.         graphics_window->portRect.left;
  21427.     screen_height = graphics_window->portRect.bottom -
  21428.         graphics_window->portRect.top;
  21429.  
  21430. //  Default view coordinate system is 2 units high, has the origin
  21431. //  at the center of the screen, and has the correct aspect ratio
  21432. //  for the display being used:
  21433.  
  21434.     aspect = get_aspect_ratio();
  21435.     set_view(2.*aspect,2.,1.*aspect,1.);
  21436.     set_color(WHITE);
  21437.     erase_graphics();
  21438. }
  21439.  
  21440. /******************************************************************
  21441. *   Bring graphics to front.  Never needed with Mac version,
  21442. *   since this is done by the drawing routines.
  21443. ******************************************************************/
  21444. void   Mac_SScreen::graphics_to_front(void)
  21445. {
  21446.     SelectWindow(graphics_window);
  21447.     erase_graphics();
  21448. }
  21449.  
  21450. /******************************************************************
  21451. *   Bring console to front.  Never needed with Mac version, since
  21452. *   this happens automatically when stdio is used.
  21453. ******************************************************************/
  21454. void   Mac_SScreen::console_to_front(void)
  21455. {
  21456.     SelectWindow(console_window);
  21457. }
  21458.  
  21459. /******************************************************************
  21460. *   Turn cursor on 
  21461. ******************************************************************/
  21462. void   Mac_SScreen::cursor_on(void)
  21463. {
  21464.     SetCursor(*CrossCursor);
  21465.     ShowCursor();
  21466. }
  21467.  
  21468. /******************************************************************
  21469. *   Turn cursor off 
  21470. ******************************************************************/
  21471. void   Mac_SScreen::cursor_off(void)
  21472. {
  21473.     HideCursor();
  21474. }
  21475.  
  21476. /******************************************************************
  21477. *   sets the current drawing color.  The colors are defined
  21478. *   in Macheaders.
  21479. ******************************************************************/
  21480. void   Mac_SScreen::set_color(int x)
  21481. {
  21482.     present_color = x;
  21483.  
  21484.     switch (x)
  21485.     {
  21486.         case 0:    ForeColor(blackColor);
  21487.                    break;
  21488.         case 1:    ForeColor(whiteColor);
  21489.                    break;
  21490.         case 2:    ForeColor(redColor);
  21491.                    break;
  21492.         case 3:    ForeColor(yellowColor);
  21493.                    break;
  21494.         case 4:    ForeColor(greenColor);
  21495.                    break;
  21496.         case 5:    ForeColor(blueColor);
  21497.                    break;
  21498.         case 6:    ForeColor(cyanColor);
  21499.                    break;
  21500.         case 7:    ForeColor(magentaColor);
  21501.                    break;
  21502.         default:   break;
  21503.     }
  21504. }
  21505.  
  21506. /******************************************************************
  21507. *   erase_graphics() calls the appropriate Mac Toolbox function to
  21508. *   make the entire screen the background color. 
  21509. ******************************************************************/
  21510. void   Mac_SScreen::erase_graphics(void)
  21511. {
  21512.     int   temp_color;
  21513.  
  21514.     if (graphics_window != FrontWindow())
  21515.     SelectWindow(graphics_window);
  21516.  
  21517.     temp_color = present_color;
  21518.     set_color(BACKGROUND);
  21519.     FillRect(&(graphics_window->portRect),black);
  21520.     set_color(temp_color);
  21521. }
  21522.  
  21523. /******************************************************************
  21524. *   Move present pen position to new position using view
  21525. *   coordinates.  After transformation into screen coordinates the
  21526. *   Macintosh QuickDraw routines are called.
  21527. ******************************************************************/
  21528. void   Mac_SScreen::move_to(double x,double y)
  21529. {
  21530.     int   screen_x,
  21531.           screen_y;
  21532.  
  21533.     if (graphics_window != FrontWindow())
  21534.     {
  21535.         SelectWindow(graphics_window);
  21536.         erase_graphics();
  21537.     }
  21538.  
  21539.     screen_x = transform_x(x);
  21540.     screen_y = transform_y(y);
  21541.  
  21542.     MoveTo(screen_x,screen_y);
  21543. }
  21544.  
  21545. /******************************************************************
  21546. *   Draw from present pen position to new position using view
  21547. *   coordinates.  After transformation into screen coordinates the
  21548. *   Macintosh QuickDraw routines are called.
  21549. ******************************************************************/
  21550. void   Mac_SScreen::draw_to(double x,double y)
  21551. {
  21552.     int   screen_x,
  21553.           screen_y;
  21554.  
  21555.     if (graphics_window != FrontWindow())
  21556.     {
  21557.         SelectWindow(graphics_window);
  21558.         erase_graphics();
  21559.     }
  21560.  
  21561.     screen_x = transform_x(x);
  21562.     screen_y = transform_y(y);
  21563.  
  21564.     LineTo(screen_x,screen_y);
  21565. }
  21566.  
  21567. /******************************************************************
  21568. *   draw_circle() draws a circle using the Mac Toolbox routines.  It
  21569. *   accepts view coordinates.
  21570. ******************************************************************/
  21571. void   Mac_SScreen::draw_circle(double x,double y,double r)
  21572. {
  21573.     Rect   myRect,
  21574.            *myRectPtr;
  21575.     int    screen_x,
  21576.            screen_y,
  21577.            screen_r;
  21578.  
  21579.     if (graphics_window != FrontWindow())
  21580.     {
  21581.         SelectWindow(graphics_window);
  21582.         erase_graphics();
  21583.     }
  21584.  
  21585.     screen_x = transform_x(x);
  21586.     screen_y = transform_y(y);
  21587.     screen_r = (int) (r*(double) screen_width/view_width);
  21588.  
  21589.     myRectPtr = &myRect;
  21590.  
  21591.     myRectPtr->left = screen_x-screen_r;
  21592.     myRectPtr->right = screen_x+screen_r;
  21593.     myRectPtr->top = screen_y-screen_r;
  21594.     myRectPtr->bottom = screen_y+screen_r;
  21595.         
  21596.     FrameOval(&myRect);
  21597. }
  21598.  
  21599. /******************************************************************
  21600. *   fill_circle() draws a circle using the Mac Toolbox routines.  It
  21601. *   accepts view coordinates.  The circle is filled with the present
  21602. *   pen color
  21603. ******************************************************************/
  21604. void   Mac_SScreen::fill_circle(double x,double y,double r)
  21605. {
  21606.     Rect   myRect,
  21607.            *myRectPtr;
  21608.     int    screen_x,
  21609.            screen_y,
  21610.            screen_r;
  21611.  
  21612.     if (graphics_window != FrontWindow())
  21613.     {
  21614.         SelectWindow(graphics_window);
  21615.         erase_graphics();
  21616.     }
  21617.  
  21618.     screen_x = transform_x(x);
  21619.     screen_y = transform_y(y);
  21620.     screen_r = (int) (r*(double) screen_width/view_width);
  21621.  
  21622.     myRectPtr = &myRect;
  21623.  
  21624.     myRectPtr->left = screen_x-screen_r;
  21625.     myRectPtr->right = screen_x+screen_r;
  21626.     myRectPtr->top = screen_y-screen_r;
  21627.     myRectPtr->bottom = screen_y+screen_r;
  21628.  
  21629.     PaintOval(&myRect);
  21630. }
  21631.  
  21632. /******************************************************************
  21633. *   mouse_button_is_down() checks whether the mouse button is down,
  21634. *   returns TRUE if so, FALSE if not.
  21635. ******************************************************************/
  21636. boolean   Mac_SScreen::mouse_button_is_down(void)
  21637. {
  21638.     return Button();
  21639. }
  21640.  
  21641. /******************************************************************
  21642. *   get_mouse_location() returns the mouse coordinates in terms of
  21643. *   the view coordinate system, using the appropriate Mac Toolbox
  21644. *   functions and the inverse transformation of that in
  21645. *   transform_x() and transform_y().
  21646. ******************************************************************/
  21647. void   Mac_SScreen::get_mouse_location(double *x_ptr,double *y_ptr)
  21648. {
  21649.     Point   mouseLoc;
  21650.  
  21651.     GetMouse(&mouseLoc);
  21652.     *x_ptr = (double) mouseLoc.h/
  21653.              (double) screen_width*view_width-view_x;
  21654.     *y_ptr = view_height-view_y-view_height*
  21655.     (double) mouseLoc.v/(double) screen_height;
  21656. }
  21657.  
  21658.  
  21659. </text>
  21660.     </content>
  21661.     <name></name>
  21662.     <script></script>
  21663. </card>
  21664.  
  21665.  
  21666. card_66988.xml
  21667. <?xml version="1.0" encoding="utf-8" ?>
  21668. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  21669. <card>
  21670.     <id>66988</id>
  21671.     <filler1>0</filler1>
  21672.     <cantDelete> <false /> </cantDelete>
  21673.     <showPict> <true /> </showPict>
  21674.     <dontSearch> <false /> </dontSearch>
  21675.     <owner>4755</owner>
  21676.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  21677.     <part>
  21678.         <id>1</id>
  21679.         <type>field</type>
  21680.         <visible> <true /> </visible>
  21681.         <dontWrap> <false /> </dontWrap>
  21682.         <dontSearch> <false /> </dontSearch>
  21683.         <sharedText> <false /> </sharedText>
  21684.         <fixedLineHeight> <true /> </fixedLineHeight>
  21685.         <autoTab> <false /> </autoTab>
  21686.         <lockText> <false /> </lockText>
  21687.         <rect>
  21688.             <left>30</left>
  21689.             <top>78</top>
  21690.             <right>478</right>
  21691.             <bottom>296</bottom>
  21692.         </rect>
  21693.         <style>scrolling</style>
  21694.         <autoSelect> <false /> </autoSelect>
  21695.         <showLines> <false /> </showLines>
  21696.         <wideMargins> <false /> </wideMargins>
  21697.         <multipleLines> <false /> </multipleLines>
  21698.         <reservedFamily> 0 </reservedFamily>
  21699.         <titleWidth>0</titleWidth>
  21700.         <icon>0</icon>
  21701.         <textAlign>left</textAlign>
  21702.         <font>Monaco</font>
  21703.         <textSize>9</textSize>
  21704.         <textStyle>plain</textStyle>
  21705.         <textHeight>12</textHeight>
  21706.         <name>code</name>
  21707.         <script></script>
  21708.     </part>
  21709.     <part>
  21710.         <id>2</id>
  21711.         <type>button</type>
  21712.         <visible> <true /> </visible>
  21713.         <reserved5> 0 </reserved5>
  21714.         <reserved4> 0 </reserved4>
  21715.         <reserved3> 0 </reserved3>
  21716.         <reserved2> 0 </reserved2>
  21717.         <reserved1> 0 </reserved1>
  21718.         <enabled> <true /> </enabled>
  21719.         <rect>
  21720.             <left>13</left>
  21721.             <top>29</top>
  21722.             <right>351</right>
  21723.             <bottom>57</bottom>
  21724.         </rect>
  21725.         <style>opaque</style>
  21726.         <showName> <false /> </showName>
  21727.         <highlight> <false /> </highlight>
  21728.         <autoHighlight> <false /> </autoHighlight>
  21729.         <sharedHighlight> <true /> </sharedHighlight>
  21730.         <family>0</family>
  21731.         <titleWidth>0</titleWidth>
  21732.         <icon>0</icon>
  21733.         <textAlign>center</textAlign>
  21734.         <font>Chicago</font>
  21735.         <textSize>12</textSize>
  21736.         <textStyle>plain</textStyle>
  21737.         <name>New Button</name>
  21738.         <script></script>
  21739.     </part>
  21740.     <part>
  21741.         <id>3</id>
  21742.         <type>button</type>
  21743.         <visible> <true /> </visible>
  21744.         <reserved5> 0 </reserved5>
  21745.         <reserved4> 0 </reserved4>
  21746.         <reserved3> 0 </reserved3>
  21747.         <reserved2> 0 </reserved2>
  21748.         <reserved1> 0 </reserved1>
  21749.         <enabled> <true /> </enabled>
  21750.         <rect>
  21751.             <left>169</left>
  21752.             <top>32</top>
  21753.             <right>305</right>
  21754.             <bottom>54</bottom>
  21755.         </rect>
  21756.         <style>roundrect</style>
  21757.         <showName> <true /> </showName>
  21758.         <highlight> <false /> </highlight>
  21759.         <autoHighlight> <true /> </autoHighlight>
  21760.         <sharedHighlight> <true /> </sharedHighlight>
  21761.         <family>0</family>
  21762.         <titleWidth>0</titleWidth>
  21763.         <icon>0</icon>
  21764.         <textAlign>center</textAlign>
  21765.         <font>Chicago</font>
  21766.         <textSize>12</textSize>
  21767.         <textStyle>plain</textStyle>
  21768.         <name>Copy to Clipboard</name>
  21769.         <script>on mouseUp
  21770. set lockscreen to true
  21771. select text of card field "code"
  21772. domenu "Copy Text"
  21773. select empty
  21774. set lockscreen to false
  21775. end mouseUp</script>
  21776.     </part>
  21777.     <content>
  21778.         <layer>background</layer>
  21779.         <id>7</id>
  21780.         <text>233</text>
  21781.     </content>
  21782.     <content>
  21783.         <layer>background</layer>
  21784.         <id>4</id>
  21785.         <text>File 5 of 5.
  21786.  
  21787.  
  21788.  
  21789.  
  21790.  
  21791.  
  21792.  
  21793.  
  21794.  
  21795.  
  21796.  
  21797. </text>
  21798.     </content>
  21799.     <content>
  21800.         <layer>background</layer>
  21801.         <id>6</id>
  21802.         <text>Application framework, database example</text>
  21803.     </content>
  21804.     <content>
  21805.         <layer>card</layer>
  21806.         <id>1</id>
  21807.         <text>/*
  21808. *   FILE:     pendulum.c
  21809. *   AUTHOR:   R. Gonzalez
  21810. *   CREATED:  Feb. 12, 1992
  21811. *
  21812. *   Demonstrate use of SScreen classes.  Uses default coordinate
  21813. *   system, with origin at center and height = 2 units.  To use
  21814. *   a different coordinate system, send a set_view() message to the
  21815. *   SScreen object.
  21816. *
  21817. *   PROJECT CONTENTS:
  21818. *   class.c, sscreen.c, msscreen.c, pendulum.c, ANSI, oops, MacTraps.
  21819. */
  21820.  
  21821. # include   "msscreen.h"  // assuming we are using a Mac
  21822. # include   <math.h>
  21823. # include   <stdio.h>
  21824.  
  21825. # define CENTER_X    0.
  21826. # define CENTER_Y    0.
  21827. # define RADIUS1    .7
  21828. # define RADIUS2    .2
  21829. # define PI            3.1415926
  21830.  
  21831. main()
  21832. {
  21833.     Generic_SScreen  *sscreen;
  21834.     double      angle = 0.,
  21835.                 increment,
  21836.                 mouse_x,
  21837.                 mouse_y,
  21838.                 x,
  21839.                 y,
  21840.                 old_x,
  21841.                 old_y;
  21842.     char        junk;
  21843.  
  21844.     sscreen = new Mac_SScreen;  // assuming we are using a Mac
  21845.  
  21846.     printf("Press RETURN to start.  Control speed with vertical\n");
  21847.     printf("mouse position; press mouse button when done...\n");
  21848.     scanf("%c",&junk);       // get RETURN character 
  21849.     
  21850.     sscreen->graphics_to_front();
  21851.     sscreen->cursor_on();
  21852.  
  21853.     old_x = RADIUS1 + CENTER_X;
  21854.     old_y = CENTER_Y;
  21855.     
  21856.     while (!sscreen->mouse_button_is_down())
  21857.     {
  21858.         x = cos(angle)*RADIUS1 + CENTER_X;
  21859.         y = sin(angle)*RADIUS1 + CENTER_Y;
  21860.         
  21861.         // Erase previous drawing:
  21862.         sscreen->set_color(BLACK);
  21863.         sscreen->draw_line(CENTER_X,CENTER_Y,old_x,old_y);
  21864.         sscreen->fill_circle(old_x,old_y,RADIUS2);
  21865.  
  21866.         sscreen->set_color(WHITE);
  21867.         sscreen->draw_line(CENTER_X,CENTER_Y,x,y);
  21868.         sscreen->fill_circle(x,y,RADIUS2);
  21869.         
  21870.         old_x = x;
  21871.         old_y = y;
  21872.         
  21873.         sscreen->get_mouse_location(&mouse_x,&mouse_y);
  21874.         increment = mouse_y;
  21875.         angle += increment;
  21876.     }
  21877.  
  21878.     sscreen->console_to_front();
  21879.     printf("All done...\n");
  21880.  
  21881.     delete sscreen;
  21882. }
  21883.  
  21884. </text>
  21885.     </content>
  21886.     <name></name>
  21887.     <script></script>
  21888. </card>
  21889.  
  21890.  
  21891. card_62767.xml
  21892. <?xml version="1.0" encoding="utf-8" ?>
  21893. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  21894. <card>
  21895.     <id>62767</id>
  21896.     <filler1>0</filler1>
  21897.     <cantDelete> <false /> </cantDelete>
  21898.     <showPict> <true /> </showPict>
  21899.     <dontSearch> <false /> </dontSearch>
  21900.     <owner>4755</owner>
  21901.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  21902.     <content>
  21903.         <layer>background</layer>
  21904.         <id>4</id>
  21905.         <text><span class="style3"> </span><span class="style7">class library</span><span class="style3"> is a collection of classes defined with an object oriented language like Think C or C++.  It usually provides general functionality in a specific area, such as mathematics, graphics, or memory management.  A programmer may call upon the services of an existing class library to reduce the overall effort required to create a new application.  This is analogous to the use of procedure libraries in traditional programming languages.
  21906.  
  21907. The OOP approach encourages the programmer to modify the functionality of an existing class library by deriving custom classes.  The programmer may make this customization without having to learn the details of the original implementation.  This increases the likelyhood of success for this form of code reuse.
  21908.  
  21909. As mentioned earlier, proprietary source code may be protected while allowing its functionality to be customized, by distributing the class library in the form of object code.  The purchaser may derive new classes from the existing ones without benefit of the source code. </span></text>
  21910.     </content>
  21911.     <content>
  21912.         <layer>background</layer>
  21913.         <id>7</id>
  21914.         <text>234</text>
  21915.     </content>
  21916.     <content>
  21917.         <layer>background</layer>
  21918.         <id>6</id>
  21919.         <text>9.3  Class Libraries</text>
  21920.     </content>
  21921.     <name></name>
  21922.     <script></script>
  21923. </card>
  21924.  
  21925.  
  21926. card_64723.xml
  21927. <?xml version="1.0" encoding="utf-8" ?>
  21928. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  21929. <card>
  21930.     <id>64723</id>
  21931.     <filler1>0</filler1>
  21932.     <cantDelete> <false /> </cantDelete>
  21933.     <showPict> <true /> </showPict>
  21934.     <dontSearch> <false /> </dontSearch>
  21935.     <owner>4755</owner>
  21936.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  21937.     <content>
  21938.         <layer>background</layer>
  21939.         <id>4</id>
  21940.         <text><span class="style3">PPLICATION FRAMEWORKS
  21941.  
  21942. An </span><span class="style7">application framework</span><span class="style3"> is a body of code which encapsulates the general structures governing the flow of control in applications.  One form of application framework is a class library which provides a generic </span><span class="style4">Application</span><span class="style3"> class, from which the programmer may derive a specific application.
  21943.  
  21944. Application frameworks are especially useful to reduce the effort required to design an event-driven application.  Typically, a generic </span><span class="style4">Application</span><span class="style3"> class for such an environment will include the event loop which looks for events (key presses, mouse clicks, etc.) and invokes the appropriate responses.  Derived applications simply register information about their user interface and the application-specific responses for user events, inheriting the event processing engine from the generic class.
  21945.  
  21946. The next section briefly describes the event-driven Think Class Library, followed by code for a much simpler example of an application framework.
  21947.  
  21948.  
  21949.  
  21950.  
  21951.  
  21952.  
  21953.  
  21954.  
  21955.  
  21956.  
  21957.  
  21958.  
  21959.  
  21960.  
  21961.  
  21962.  
  21963.  
  21964. </span></text>
  21965.     </content>
  21966.     <content>
  21967.         <layer>background</layer>
  21968.         <id>7</id>
  21969.         <text>235</text>
  21970.     </content>
  21971.     <name></name>
  21972.     <script></script>
  21973. </card>
  21974.  
  21975.  
  21976. card_73623.xml
  21977. <?xml version="1.0" encoding="utf-8" ?>
  21978. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  21979. <card>
  21980.     <id>73623</id>
  21981.     <filler1>0</filler1>
  21982.     <cantDelete> <false /> </cantDelete>
  21983.     <showPict> <true /> </showPict>
  21984.     <dontSearch> <false /> </dontSearch>
  21985.     <owner>4755</owner>
  21986.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  21987.     <content>
  21988.         <layer>background</layer>
  21989.         <id>7</id>
  21990.         <text>236</text>
  21991.     </content>
  21992.     <content>
  21993.         <layer>background</layer>
  21994.         <id>4</id>
  21995.         <text><span class="style3">HINK CLASS LIBRARY
  21996.  
  21997. In addition to the standard C function libraries and specialized function libraries for the Macintosh (which call the Macintosh Toolbox ROM routines), Think C comes with the Think Class Library (TCL).  The TCL contains an application framework defining many useful classes for writing Macintosh applications.
  21998.  
  21999. TCL classes encapsulate the data and functionality needed to implement an event-driven </span><span class="style4">Application</span><span class="style3"> dealing with </span><span class="style4">Files</span><span class="style3">, </span><span class="style4">Windows</span><span class="style3">, </span><span class="style4">ScrollBars</span><span class="style3">, </span><span class="style4">Pictures</span><span class="style3">, </span><span class="style4">EditText</span><span class="style3"> fields, </span><span class="style4">CheckBoxes</span><span class="style3">, etc.
  22000.  
  22001. In this way many of the complexities of the Macintosh graphical user interface are "hidden" from the programmer, yet the programmer has the ability to derive new classes from the TCL classes to obtain specialized functionality.
  22002.  
  22003. The Think C manuals discuss the functioning of the TCL in detail.  A working knowledge of the Macintosh Toolbox ROM routines is recommended for using the 
  22004. </span></text>
  22005.     </content>
  22006.     <name></name>
  22007.     <script></script>
  22008. </card>
  22009.  
  22010.  
  22011. card_73880.xml
  22012. <?xml version="1.0" encoding="utf-8" ?>
  22013. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  22014. <card>
  22015.     <id>73880</id>
  22016.     <filler1>0</filler1>
  22017.     <cantDelete> <false /> </cantDelete>
  22018.     <showPict> <true /> </showPict>
  22019.     <dontSearch> <false /> </dontSearch>
  22020.     <owner>4755</owner>
  22021.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  22022.     <content>
  22023.         <layer>background</layer>
  22024.         <id>4</id>
  22025.         <text>TCL to construct applications faithful to the Macintosh interface.
  22026.  
  22027. Similar graphics class libraries exist in several C++ environments.  The potential exists for the standardization of class libraries such as the TCL, to allow cross-platform development using graphical user interfaces.*
  22028.  
  22029. </text>
  22030.     </content>
  22031.     <content>
  22032.         <layer>background</layer>
  22033.         <id>7</id>
  22034.         <text>237</text>
  22035.     </content>
  22036.     <content>
  22037.         <layer>background</layer>
  22038.         <id>29</id>
  22039.         <text>61284</text>
  22040.     </content>
  22041.     <content>
  22042.         <layer>background</layer>
  22043.         <id>27</id>
  22044.         <text>Portability</text>
  22045.     </content>
  22046.     <content>
  22047.         <layer>background</layer>
  22048.         <id>20</id>
  22049.         <text>Portability - p226</text>
  22050.     </content>
  22051.     <name></name>
  22052.     <script></script>
  22053. </card>
  22054.  
  22055.  
  22056. card_65394.xml
  22057. <?xml version="1.0" encoding="utf-8" ?>
  22058. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  22059. <card>
  22060.     <id>65394</id>
  22061.     <filler1>0</filler1>
  22062.     <cantDelete> <false /> </cantDelete>
  22063.     <showPict> <true /> </showPict>
  22064.     <dontSearch> <false /> </dontSearch>
  22065.     <owner>4755</owner>
  22066.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  22067.     <content>
  22068.         <layer>background</layer>
  22069.         <id>4</id>
  22070.         <text><span class="style3">N APPLICATION FRAMEWORK EXAMPLE
  22071.  
  22072. The following pages contain source code for a simple Think C/C++ application framework.  Each page contains a scrolling text field whose contents may be pasted into an individual file for compilation.  The files </span><span class="style18">class.h</span><span class="style3"> and </span><span class="style18">class.c</span><span class="style3"> from the example in Chapter 4 are also required.
  22073.  
  22074. The </span><span class="style4">Generic_App</span><span class="style3"> class handles menu-driven applications, with the restriction of a text-only (stdio) interface.  The programmer must define a new class whose parent is </span><span class="style4">Generic_App</span><span class="style3">.  In this example, the new class is </span><span class="style4">Data_App</span><span class="style3">, and represents a simplified database-type application.  Instructions on deriving your own applications are given in </span><span class="style18">app.h</span><span class="style3">.
  22075.  
  22076. </span><span class="style4">Data_App</span><span class="style3"> is initialized by associating command names with pointers to the methods to be invoked in response to each command.  The </span><span class="style4">run()</span><span class="style3"> method inherited from </span><span class="style4">Generic_App</span><span class="style3"> produces the specified user interface and handles menu selections automatically.
  22077.  
  22078. </span></text>
  22079.     </content>
  22080.     <content>
  22081.         <layer>background</layer>
  22082.         <id>7</id>
  22083.         <text>238</text>
  22084.     </content>
  22085.     <name></name>
  22086.     <script></script>
  22087. </card>
  22088.  
  22089.  
  22090. card_65642.xml
  22091. <?xml version="1.0" encoding="utf-8" ?>
  22092. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  22093. <card>
  22094.     <id>65642</id>
  22095.     <filler1>0</filler1>
  22096.     <bitmap>BMAP_65828.pbm</bitmap>
  22097.     <cantDelete> <false /> </cantDelete>
  22098.     <showPict> <true /> </showPict>
  22099.     <dontSearch> <false /> </dontSearch>
  22100.     <owner>4755</owner>
  22101.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  22102.     <part>
  22103.         <id>3</id>
  22104.         <type>field</type>
  22105.         <visible> <true /> </visible>
  22106.         <dontWrap> <false /> </dontWrap>
  22107.         <dontSearch> <false /> </dontSearch>
  22108.         <sharedText> <false /> </sharedText>
  22109.         <fixedLineHeight> <false /> </fixedLineHeight>
  22110.         <autoTab> <false /> </autoTab>
  22111.         <lockText> <false /> </lockText>
  22112.         <rect>
  22113.             <left>351</left>
  22114.             <top>169</top>
  22115.             <right>480</right>
  22116.             <bottom>192</bottom>
  22117.         </rect>
  22118.         <style>shadow</style>
  22119.         <autoSelect> <false /> </autoSelect>
  22120.         <showLines> <false /> </showLines>
  22121.         <wideMargins> <true /> </wideMargins>
  22122.         <multipleLines> <false /> </multipleLines>
  22123.         <reservedFamily> 0 </reservedFamily>
  22124.         <titleWidth>0</titleWidth>
  22125.         <icon>0</icon>
  22126.         <textAlign>center</textAlign>
  22127.         <font>Monaco</font>
  22128.         <textSize>9</textSize>
  22129.         <textStyle>plain</textStyle>
  22130.         <textHeight>12</textHeight>
  22131.         <name></name>
  22132.         <script></script>
  22133.     </part>
  22134.     <part>
  22135.         <id>4</id>
  22136.         <type>field</type>
  22137.         <visible> <true /> </visible>
  22138.         <dontWrap> <false /> </dontWrap>
  22139.         <dontSearch> <false /> </dontSearch>
  22140.         <sharedText> <false /> </sharedText>
  22141.         <fixedLineHeight> <false /> </fixedLineHeight>
  22142.         <autoTab> <false /> </autoTab>
  22143.         <lockText> <false /> </lockText>
  22144.         <rect>
  22145.             <left>191</left>
  22146.             <top>113</top>
  22147.             <right>320</right>
  22148.             <bottom>136</bottom>
  22149.         </rect>
  22150.         <style>shadow</style>
  22151.         <autoSelect> <false /> </autoSelect>
  22152.         <showLines> <false /> </showLines>
  22153.         <wideMargins> <true /> </wideMargins>
  22154.         <multipleLines> <false /> </multipleLines>
  22155.         <reservedFamily> 0 </reservedFamily>
  22156.         <titleWidth>0</titleWidth>
  22157.         <icon>0</icon>
  22158.         <textAlign>center</textAlign>
  22159.         <font>Monaco</font>
  22160.         <textSize>9</textSize>
  22161.         <textStyle>plain</textStyle>
  22162.         <textHeight>12</textHeight>
  22163.         <name></name>
  22164.         <script></script>
  22165.     </part>
  22166.     <part>
  22167.         <id>5</id>
  22168.         <type>field</type>
  22169.         <visible> <true /> </visible>
  22170.         <dontWrap> <false /> </dontWrap>
  22171.         <dontSearch> <false /> </dontSearch>
  22172.         <sharedText> <false /> </sharedText>
  22173.         <fixedLineHeight> <false /> </fixedLineHeight>
  22174.         <autoTab> <false /> </autoTab>
  22175.         <lockText> <false /> </lockText>
  22176.         <rect>
  22177.             <left>30</left>
  22178.             <top>169</top>
  22179.             <right>159</right>
  22180.             <bottom>192</bottom>
  22181.         </rect>
  22182.         <style>shadow</style>
  22183.         <autoSelect> <false /> </autoSelect>
  22184.         <showLines> <false /> </showLines>
  22185.         <wideMargins> <true /> </wideMargins>
  22186.         <multipleLines> <false /> </multipleLines>
  22187.         <reservedFamily> 0 </reservedFamily>
  22188.         <titleWidth>0</titleWidth>
  22189.         <icon>0</icon>
  22190.         <textAlign>center</textAlign>
  22191.         <font>Monaco</font>
  22192.         <textSize>9</textSize>
  22193.         <textStyle>plain</textStyle>
  22194.         <textHeight>12</textHeight>
  22195.         <name></name>
  22196.         <script></script>
  22197.     </part>
  22198.     <part>
  22199.         <id>6</id>
  22200.         <type>field</type>
  22201.         <visible> <true /> </visible>
  22202.         <dontWrap> <false /> </dontWrap>
  22203.         <dontSearch> <false /> </dontSearch>
  22204.         <sharedText> <false /> </sharedText>
  22205.         <fixedLineHeight> <false /> </fixedLineHeight>
  22206.         <autoTab> <false /> </autoTab>
  22207.         <lockText> <false /> </lockText>
  22208.         <rect>
  22209.             <left>191</left>
  22210.             <top>169</top>
  22211.             <right>320</right>
  22212.             <bottom>204</bottom>
  22213.         </rect>
  22214.         <style>shadow</style>
  22215.         <autoSelect> <false /> </autoSelect>
  22216.         <showLines> <false /> </showLines>
  22217.         <wideMargins> <true /> </wideMargins>
  22218.         <multipleLines> <false /> </multipleLines>
  22219.         <reservedFamily> 0 </reservedFamily>
  22220.         <titleWidth>0</titleWidth>
  22221.         <icon>0</icon>
  22222.         <textAlign>center</textAlign>
  22223.         <font>Monaco</font>
  22224.         <textSize>9</textSize>
  22225.         <textStyle>plain</textStyle>
  22226.         <textHeight>12</textHeight>
  22227.         <name></name>
  22228.         <script></script>
  22229.     </part>
  22230.     <part>
  22231.         <id>7</id>
  22232.         <type>field</type>
  22233.         <visible> <true /> </visible>
  22234.         <dontWrap> <false /> </dontWrap>
  22235.         <dontSearch> <false /> </dontSearch>
  22236.         <sharedText> <false /> </sharedText>
  22237.         <fixedLineHeight> <false /> </fixedLineHeight>
  22238.         <autoTab> <false /> </autoTab>
  22239.         <lockText> <false /> </lockText>
  22240.         <rect>
  22241.             <left>191</left>
  22242.             <top>234</top>
  22243.             <right>320</right>
  22244.             <bottom>269</bottom>
  22245.         </rect>
  22246.         <style>shadow</style>
  22247.         <autoSelect> <false /> </autoSelect>
  22248.         <showLines> <false /> </showLines>
  22249.         <wideMargins> <true /> </wideMargins>
  22250.         <multipleLines> <false /> </multipleLines>
  22251.         <reservedFamily> 0 </reservedFamily>
  22252.         <titleWidth>0</titleWidth>
  22253.         <icon>0</icon>
  22254.         <textAlign>center</textAlign>
  22255.         <font>Monaco</font>
  22256.         <textSize>9</textSize>
  22257.         <textStyle>plain</textStyle>
  22258.         <textHeight>12</textHeight>
  22259.         <name></name>
  22260.         <script></script>
  22261.     </part>
  22262.     <content>
  22263.         <layer>card</layer>
  22264.         <id>4</id>
  22265.         <text>Generic_Class</text>
  22266.     </content>
  22267.     <content>
  22268.         <layer>card</layer>
  22269.         <id>5</id>
  22270.         <text>Menu</text>
  22271.     </content>
  22272.     <content>
  22273.         <layer>card</layer>
  22274.         <id>3</id>
  22275.         <text>Dfile</text>
  22276.     </content>
  22277.     <content>
  22278.         <layer>card</layer>
  22279.         <id>6</id>
  22280.         <text><span class="style3">eneric_App
  22281. </span><span class="style11">(contains:  </span><span class="style3">Menu</span><span class="style11">)</span></text>
  22282.     </content>
  22283.     <content>
  22284.         <layer>background</layer>
  22285.         <id>4</id>
  22286.         <text>The inheritance relationship among these classes (the class hierarchy) is illustrated below:
  22287.  
  22288.  
  22289.  
  22290.  
  22291.  
  22292.  
  22293.  
  22294.  
  22295.  
  22296. </text>
  22297.     </content>
  22298.     <content>
  22299.         <layer>card</layer>
  22300.         <id>7</id>
  22301.         <text><span class="style3">ata_App
  22302. </span><span class="style11">(contains:  </span><span class="style3">Dfile</span><span class="style11">)</span></text>
  22303.     </content>
  22304.     <content>
  22305.         <layer>background</layer>
  22306.         <id>7</id>
  22307.         <text>239</text>
  22308.     </content>
  22309.     <name></name>
  22310.     <script></script>
  22311. </card>
  22312.  
  22313.  
  22314. card_30418.xml
  22315. <?xml version="1.0" encoding="utf-8" ?>
  22316. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  22317. <card>
  22318.     <id>30418</id>
  22319.     <filler1>0</filler1>
  22320.     <cantDelete> <false /> </cantDelete>
  22321.     <showPict> <true /> </showPict>
  22322.     <dontSearch> <false /> </dontSearch>
  22323.     <owner>4755</owner>
  22324.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  22325.     <part>
  22326.         <id>1</id>
  22327.         <type>field</type>
  22328.         <visible> <true /> </visible>
  22329.         <dontWrap> <false /> </dontWrap>
  22330.         <dontSearch> <false /> </dontSearch>
  22331.         <sharedText> <false /> </sharedText>
  22332.         <fixedLineHeight> <true /> </fixedLineHeight>
  22333.         <autoTab> <false /> </autoTab>
  22334.         <lockText> <false /> </lockText>
  22335.         <rect>
  22336.             <left>30</left>
  22337.             <top>78</top>
  22338.             <right>478</right>
  22339.             <bottom>296</bottom>
  22340.         </rect>
  22341.         <style>scrolling</style>
  22342.         <autoSelect> <false /> </autoSelect>
  22343.         <showLines> <false /> </showLines>
  22344.         <wideMargins> <false /> </wideMargins>
  22345.         <multipleLines> <false /> </multipleLines>
  22346.         <reservedFamily> 0 </reservedFamily>
  22347.         <titleWidth>0</titleWidth>
  22348.         <icon>0</icon>
  22349.         <textAlign>left</textAlign>
  22350.         <font>Monaco</font>
  22351.         <textSize>9</textSize>
  22352.         <textStyle>plain</textStyle>
  22353.         <textHeight>12</textHeight>
  22354.         <name>code</name>
  22355.         <script></script>
  22356.     </part>
  22357.     <part>
  22358.         <id>2</id>
  22359.         <type>button</type>
  22360.         <visible> <true /> </visible>
  22361.         <reserved5> 0 </reserved5>
  22362.         <reserved4> 0 </reserved4>
  22363.         <reserved3> 0 </reserved3>
  22364.         <reserved2> 0 </reserved2>
  22365.         <reserved1> 0 </reserved1>
  22366.         <enabled> <true /> </enabled>
  22367.         <rect>
  22368.             <left>13</left>
  22369.             <top>29</top>
  22370.             <right>351</right>
  22371.             <bottom>57</bottom>
  22372.         </rect>
  22373.         <style>opaque</style>
  22374.         <showName> <false /> </showName>
  22375.         <highlight> <false /> </highlight>
  22376.         <autoHighlight> <false /> </autoHighlight>
  22377.         <sharedHighlight> <true /> </sharedHighlight>
  22378.         <family>0</family>
  22379.         <titleWidth>0</titleWidth>
  22380.         <icon>0</icon>
  22381.         <textAlign>center</textAlign>
  22382.         <font>Chicago</font>
  22383.         <textSize>12</textSize>
  22384.         <textStyle>plain</textStyle>
  22385.         <name>New Button</name>
  22386.         <script></script>
  22387.     </part>
  22388.     <part>
  22389.         <id>3</id>
  22390.         <type>button</type>
  22391.         <visible> <true /> </visible>
  22392.         <reserved5> 0 </reserved5>
  22393.         <reserved4> 0 </reserved4>
  22394.         <reserved3> 0 </reserved3>
  22395.         <reserved2> 0 </reserved2>
  22396.         <reserved1> 0 </reserved1>
  22397.         <enabled> <true /> </enabled>
  22398.         <rect>
  22399.             <left>169</left>
  22400.             <top>32</top>
  22401.             <right>305</right>
  22402.             <bottom>54</bottom>
  22403.         </rect>
  22404.         <style>roundrect</style>
  22405.         <showName> <true /> </showName>
  22406.         <highlight> <false /> </highlight>
  22407.         <autoHighlight> <true /> </autoHighlight>
  22408.         <sharedHighlight> <true /> </sharedHighlight>
  22409.         <family>0</family>
  22410.         <titleWidth>0</titleWidth>
  22411.         <icon>0</icon>
  22412.         <textAlign>center</textAlign>
  22413.         <font>Chicago</font>
  22414.         <textSize>12</textSize>
  22415.         <textStyle>plain</textStyle>
  22416.         <name>Copy to Clipboard</name>
  22417.         <script>on mouseUp
  22418. set lockscreen to true
  22419. select text of card field "code"
  22420. domenu "Copy Text"
  22421. select empty
  22422. set lockscreen to false
  22423. end mouseUp</script>
  22424.     </part>
  22425.     <content>
  22426.         <layer>background</layer>
  22427.         <id>7</id>
  22428.         <text>240</text>
  22429.     </content>
  22430.     <content>
  22431.         <layer>background</layer>
  22432.         <id>4</id>
  22433.         <text>File 1 of 8.  A TC/C++ application framework and database application:
  22434.  
  22435.  
  22436.  
  22437.  
  22438.  
  22439.  
  22440.  
  22441.  
  22442.  
  22443.  
  22444.  
  22445. </text>
  22446.     </content>
  22447.     <content>
  22448.         <layer>background</layer>
  22449.         <id>6</id>
  22450.         <text>Application framework, database example</text>
  22451.     </content>
  22452.     <content>
  22453.         <layer>card</layer>
  22454.         <id>1</id>
  22455.         <text>/*
  22456. *   FILE:       app.h
  22457. *   AUTHOR:     R. Gonzalez
  22458. *   CREATED:    Feb. 3, 1992
  22459. *
  22460. *   Defines generic application class for a menu-driven interface.
  22461. *
  22462. *   Limitations:  The user interface of the programmer's application
  22463. *   must rely upon a set of textual commands.  No graphics are
  22464. *   provided for, in keeping with the lowest-common-denominator user
  22465. *   interface.
  22466. *
  22467. **********************************************************************
  22468. *
  22469. *   Here's how to write your own application class My_App.  Create
  22470. *   myapp.h which derives My_App from Generic_App.  Use static to
  22471. *   declare all new variables to be class variables (see below), and
  22472. *   allocate and initialize them appropriately.
  22473. *
  22474. *   Next, create the source file myapp.c.  Here you should define
  22475. *   class methods for each command your application will handle.
  22476. *   Each of these should return a boolean indicating whether the
  22477. *   user misused the command.  For example:
  22478. *
  22479. *       static boolean  My_App::open(void)
  22480. *       {
  22481. *           char    filename[80];
  22482. *
  22483. *           printf("Enter file name:\n");
  22484. *           scanf("%s",filename);
  22485. *           file = fopen(filename,"r"); // file is a class variable
  22486. *               .
  22487. *               .
  22488. *       }
  22489. *   
  22490. *   In your constructor send log_command messages to the
  22491. *   (inherited) menu instance variable to associate a command name
  22492. *   with the pointer to the corresponding class method.  This allows
  22493. *   the inherited method dispatching mechanism to work.
  22494. *
  22495. **********************************************************************
  22496. *
  22497. *   NOTE:  This version logs the command name and number, as well as
  22498. *   a pointer to the corresponding method, into the menu object.  The
  22499. *   current implementation of TC does not support taking the address
  22500. *   of a non-static method.  Instead, class methods are used.  This in
  22501. *   turn requires the use of class variables instead of conventional
  22502. *   instance variables.
  22503. *   
  22504. *   In an earlier version, the programmer did not log a pointer to
  22505. *   the command function into the menu; rather, he/she had to write a
  22506. *   do_command() method for the new application which contained a case
  22507. *   statement selecting the method associated with the command
  22508. *   chosen.  This is similar to how the Think Class Library is used.
  22509. *   This approach allowed the command methods to be non-static
  22510. *   but left the burden of method dispatching on the user.
  22511. *
  22512. *********************************************************************/
  22513.  
  22514. # ifndef    app_h
  22515. # define    app_h
  22516.  
  22517. # include   "class.h"
  22518.  
  22519. class   Menu;
  22520.  
  22521. /********************************************************************
  22522. *   abstract application class
  22523. ********************************************************************/
  22524. class   Generic_App:public Generic_Class
  22525. {
  22526. private:
  22527.     static boolean      done;
  22528.  
  22529. protected:
  22530.     Menu                *menu;
  22531.     
  22532. public:
  22533.     Generic_App(void);
  22534.     virtual void        run(void);
  22535.     static boolean      quit(void); // "protected" is ok with Think C?
  22536.     virtual ~Generic_App(void);
  22537. };
  22538.  
  22539. # include   "menu.h"
  22540.  
  22541. # endif
  22542. </text>
  22543.     </content>
  22544.     <name></name>
  22545.     <script></script>
  22546. </card>
  22547.  
  22548.  
  22549. card_63445.xml
  22550. <?xml version="1.0" encoding="utf-8" ?>
  22551. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  22552. <card>
  22553.     <id>63445</id>
  22554.     <filler1>0</filler1>
  22555.     <cantDelete> <false /> </cantDelete>
  22556.     <showPict> <true /> </showPict>
  22557.     <dontSearch> <false /> </dontSearch>
  22558.     <owner>4755</owner>
  22559.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  22560.     <part>
  22561.         <id>1</id>
  22562.         <type>field</type>
  22563.         <visible> <true /> </visible>
  22564.         <dontWrap> <false /> </dontWrap>
  22565.         <dontSearch> <false /> </dontSearch>
  22566.         <sharedText> <false /> </sharedText>
  22567.         <fixedLineHeight> <true /> </fixedLineHeight>
  22568.         <autoTab> <false /> </autoTab>
  22569.         <lockText> <false /> </lockText>
  22570.         <rect>
  22571.             <left>30</left>
  22572.             <top>78</top>
  22573.             <right>478</right>
  22574.             <bottom>296</bottom>
  22575.         </rect>
  22576.         <style>scrolling</style>
  22577.         <autoSelect> <false /> </autoSelect>
  22578.         <showLines> <false /> </showLines>
  22579.         <wideMargins> <false /> </wideMargins>
  22580.         <multipleLines> <false /> </multipleLines>
  22581.         <reservedFamily> 0 </reservedFamily>
  22582.         <titleWidth>0</titleWidth>
  22583.         <icon>0</icon>
  22584.         <textAlign>left</textAlign>
  22585.         <font>Monaco</font>
  22586.         <textSize>9</textSize>
  22587.         <textStyle>plain</textStyle>
  22588.         <textHeight>12</textHeight>
  22589.         <name>code</name>
  22590.         <script></script>
  22591.     </part>
  22592.     <part>
  22593.         <id>2</id>
  22594.         <type>button</type>
  22595.         <visible> <true /> </visible>
  22596.         <reserved5> 0 </reserved5>
  22597.         <reserved4> 0 </reserved4>
  22598.         <reserved3> 0 </reserved3>
  22599.         <reserved2> 0 </reserved2>
  22600.         <reserved1> 0 </reserved1>
  22601.         <enabled> <true /> </enabled>
  22602.         <rect>
  22603.             <left>169</left>
  22604.             <top>32</top>
  22605.             <right>305</right>
  22606.             <bottom>54</bottom>
  22607.         </rect>
  22608.         <style>roundrect</style>
  22609.         <showName> <true /> </showName>
  22610.         <highlight> <false /> </highlight>
  22611.         <autoHighlight> <true /> </autoHighlight>
  22612.         <sharedHighlight> <true /> </sharedHighlight>
  22613.         <family>0</family>
  22614.         <titleWidth>0</titleWidth>
  22615.         <icon>0</icon>
  22616.         <textAlign>center</textAlign>
  22617.         <font>Chicago</font>
  22618.         <textSize>12</textSize>
  22619.         <textStyle>plain</textStyle>
  22620.         <name>Copy to Clipboard</name>
  22621.         <script>on mouseUp
  22622. set lockscreen to true
  22623. select text of card field "code"
  22624. domenu "Copy Text"
  22625. select empty
  22626. set lockscreen to false
  22627. end mouseUp</script>
  22628.     </part>
  22629.     <content>
  22630.         <layer>background</layer>
  22631.         <id>7</id>
  22632.         <text>241</text>
  22633.     </content>
  22634.     <content>
  22635.         <layer>background</layer>
  22636.         <id>4</id>
  22637.         <text>File 2 of 8.</text>
  22638.     </content>
  22639.     <content>
  22640.         <layer>card</layer>
  22641.         <id>1</id>
  22642.         <text>/*
  22643. *   FILE:       app.c
  22644. *   AUTHOR:     R. Gonzalez
  22645. *   CREATED:    Feb. 3, 1992
  22646. *
  22647. *   Defines generic menu-driven application methods.
  22648. */
  22649.  
  22650. # include   <stdlib.h>
  22651. # include   <stdio.h>
  22652. # include   "app.h"
  22653.  
  22654. boolean Generic_App::done = FALSE;
  22655.  
  22656. /*********************************************************************
  22657. *   initialize application.
  22658. *********************************************************************/
  22659. Generic_App::Generic_App(void)
  22660. {
  22661.     menu = new Menu;
  22662.     initialized = initialized &&
  22663.         (menu != NULL) && menu->is_initialized();
  22664.  
  22665.     if (initialized)
  22666.     {
  22667.         menu->log_command(1,0,"File",NULL);
  22668.         menu->log_command(1,1,"Quit",quit);
  22669.     }
  22670. }
  22671.  
  22672. /*********************************************************************
  22673. *   execute application - this is handled in derived classes
  22674. *********************************************************************/
  22675. void    Generic_App::run(void)
  22676. {
  22677.     int     menu_num,
  22678.             item,
  22679.             i;
  22680.     char    carriage_return;
  22681.     comfunc command_ptr;
  22682.     
  22683.     while (!done)
  22684.     {
  22685.         printf("\n");
  22686.         for (i=1 ; i<= menu->num_menus ; i++)
  22687.             printf("%d\t%s\n",i,menu->command[i][0]);
  22688.         printf("\n");
  22689.         printf("Enter main command number:\n");
  22690.         scanf("%d",&menu_num);
  22691.         carriage_return = getchar();
  22692.         
  22693.         if (menu_num > 0 && menu_num <= menu->num_menus)
  22694.         {
  22695.             printf("\n");
  22696.             for (i=1 ; i<menu->num_items[menu_num] ; i++)
  22697.                 printf("%d\t%s\n",i,menu->command[menu_num][i]);
  22698.             printf("\n");
  22699.             printf("Enter command number:\n");
  22700.             scanf("%d",&item);
  22701.             carriage_return = getchar();
  22702.             printf("\n");
  22703.             
  22704.             if (item > 0 && item < menu->num_items[menu_num])
  22705.             {
  22706.                 command_ptr = menu->get_command_ptr(menu_num,item);
  22707.                 // Run command and check whether it fails:
  22708.                 if (!(*command_ptr)())
  22709.                     printf("Illegal usage.\n");
  22710.             }
  22711.             else
  22712.                 printf("Illegal command.\n");
  22713.         }
  22714.         else
  22715.             printf("Illegal command.\n");
  22716.     }
  22717. }
  22718.  
  22719. /*********************************************************************
  22720. *   dispose application.
  22721. *********************************************************************/
  22722. Generic_App::~Generic_App(void)
  22723. {
  22724.     delete menu;
  22725. }
  22726.  
  22727. /*--------------------------- commands -----------------------------*/
  22728.  
  22729. /*********************************************************************
  22730. *   quit - by default the only command available.
  22731. *********************************************************************/
  22732. boolean Generic_App::quit(void)
  22733. {
  22734.     done = TRUE;
  22735.     return TRUE;
  22736. }
  22737.  
  22738.  
  22739. </text>
  22740.     </content>
  22741.     <name></name>
  22742.     <script></script>
  22743. </card>
  22744.  
  22745.  
  22746. card_63593.xml
  22747. <?xml version="1.0" encoding="utf-8" ?>
  22748. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  22749. <card>
  22750.     <id>63593</id>
  22751.     <filler1>0</filler1>
  22752.     <cantDelete> <false /> </cantDelete>
  22753.     <showPict> <true /> </showPict>
  22754.     <dontSearch> <false /> </dontSearch>
  22755.     <owner>4755</owner>
  22756.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  22757.     <part>
  22758.         <id>1</id>
  22759.         <type>field</type>
  22760.         <visible> <true /> </visible>
  22761.         <dontWrap> <false /> </dontWrap>
  22762.         <dontSearch> <false /> </dontSearch>
  22763.         <sharedText> <false /> </sharedText>
  22764.         <fixedLineHeight> <true /> </fixedLineHeight>
  22765.         <autoTab> <false /> </autoTab>
  22766.         <lockText> <false /> </lockText>
  22767.         <rect>
  22768.             <left>30</left>
  22769.             <top>78</top>
  22770.             <right>478</right>
  22771.             <bottom>296</bottom>
  22772.         </rect>
  22773.         <style>scrolling</style>
  22774.         <autoSelect> <false /> </autoSelect>
  22775.         <showLines> <false /> </showLines>
  22776.         <wideMargins> <false /> </wideMargins>
  22777.         <multipleLines> <false /> </multipleLines>
  22778.         <reservedFamily> 0 </reservedFamily>
  22779.         <titleWidth>0</titleWidth>
  22780.         <icon>0</icon>
  22781.         <textAlign>left</textAlign>
  22782.         <font>Monaco</font>
  22783.         <textSize>9</textSize>
  22784.         <textStyle>plain</textStyle>
  22785.         <textHeight>12</textHeight>
  22786.         <name>code</name>
  22787.         <script></script>
  22788.     </part>
  22789.     <part>
  22790.         <id>2</id>
  22791.         <type>button</type>
  22792.         <visible> <true /> </visible>
  22793.         <reserved5> 0 </reserved5>
  22794.         <reserved4> 0 </reserved4>
  22795.         <reserved3> 0 </reserved3>
  22796.         <reserved2> 0 </reserved2>
  22797.         <reserved1> 0 </reserved1>
  22798.         <enabled> <true /> </enabled>
  22799.         <rect>
  22800.             <left>169</left>
  22801.             <top>32</top>
  22802.             <right>305</right>
  22803.             <bottom>54</bottom>
  22804.         </rect>
  22805.         <style>roundrect</style>
  22806.         <showName> <true /> </showName>
  22807.         <highlight> <false /> </highlight>
  22808.         <autoHighlight> <true /> </autoHighlight>
  22809.         <sharedHighlight> <true /> </sharedHighlight>
  22810.         <family>0</family>
  22811.         <titleWidth>0</titleWidth>
  22812.         <icon>0</icon>
  22813.         <textAlign>center</textAlign>
  22814.         <font>Chicago</font>
  22815.         <textSize>12</textSize>
  22816.         <textStyle>plain</textStyle>
  22817.         <name>Copy to Clipboard</name>
  22818.         <script>on mouseUp
  22819. set lockscreen to true
  22820. select text of card field "code"
  22821. domenu "Copy Text"
  22822. select empty
  22823. set lockscreen to false
  22824. end mouseUp</script>
  22825.     </part>
  22826.     <content>
  22827.         <layer>background</layer>
  22828.         <id>4</id>
  22829.         <text>File 3 of 8.</text>
  22830.     </content>
  22831.     <content>
  22832.         <layer>background</layer>
  22833.         <id>7</id>
  22834.         <text>242</text>
  22835.     </content>
  22836.     <content>
  22837.         <layer>card</layer>
  22838.         <id>1</id>
  22839.         <text>/*
  22840. *   FILE:       menu.h
  22841. *   AUTHOR:     R. Gonzalez
  22842. *   CREATED:    Feb. 3, 1992
  22843. *
  22844. *   Defines menu class for Generic_App.
  22845. */
  22846.  
  22847. # ifndef    menu_h
  22848. # define    menu_h
  22849.  
  22850. # include   "class.h"
  22851.  
  22852. # define    MAX_MENUS   20
  22853. # define    MAX_ITEMS   20
  22854. # define    ILLEGAL     -1
  22855.  
  22856. // pointer to class method used to implement a command:
  22857. typedef boolean (*comfunc)(void);
  22858.  
  22859. /*********************************************************************
  22860. *   menu
  22861. *********************************************************************/
  22862. class   Menu:public Generic_Class
  22863. {
  22864. private:
  22865.     comfunc         command_ptr[MAX_MENUS+1][MAX_ITEMS+1];
  22866.     
  22867. public:
  22868.     int             num_menus;
  22869.     int             num_items[MAX_MENUS+1];
  22870.     char            *command[MAX_MENUS+1][MAX_ITEMS+1];
  22871.     Menu(void);
  22872.     virtual boolean log_command(int,int,char*,comfunc);
  22873.     virtual int     get_menu(char*);
  22874.     virtual int     get_item(char*);
  22875.     virtual comfunc get_command_ptr(int,int);
  22876. };
  22877.  
  22878. # endif
  22879. </text>
  22880.     </content>
  22881.     <name></name>
  22882.     <script></script>
  22883. </card>
  22884.  
  22885.  
  22886. card_56859.xml
  22887. <?xml version="1.0" encoding="utf-8" ?>
  22888. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  22889. <card>
  22890.     <id>56859</id>
  22891.     <filler1>0</filler1>
  22892.     <cantDelete> <false /> </cantDelete>
  22893.     <showPict> <true /> </showPict>
  22894.     <dontSearch> <false /> </dontSearch>
  22895.     <owner>4755</owner>
  22896.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  22897.     <part>
  22898.         <id>1</id>
  22899.         <type>field</type>
  22900.         <visible> <true /> </visible>
  22901.         <dontWrap> <false /> </dontWrap>
  22902.         <dontSearch> <false /> </dontSearch>
  22903.         <sharedText> <false /> </sharedText>
  22904.         <fixedLineHeight> <true /> </fixedLineHeight>
  22905.         <autoTab> <false /> </autoTab>
  22906.         <lockText> <false /> </lockText>
  22907.         <rect>
  22908.             <left>30</left>
  22909.             <top>78</top>
  22910.             <right>478</right>
  22911.             <bottom>296</bottom>
  22912.         </rect>
  22913.         <style>scrolling</style>
  22914.         <autoSelect> <false /> </autoSelect>
  22915.         <showLines> <false /> </showLines>
  22916.         <wideMargins> <false /> </wideMargins>
  22917.         <multipleLines> <false /> </multipleLines>
  22918.         <reservedFamily> 0 </reservedFamily>
  22919.         <titleWidth>0</titleWidth>
  22920.         <icon>0</icon>
  22921.         <textAlign>left</textAlign>
  22922.         <font>Monaco</font>
  22923.         <textSize>9</textSize>
  22924.         <textStyle>plain</textStyle>
  22925.         <textHeight>12</textHeight>
  22926.         <name>code</name>
  22927.         <script></script>
  22928.     </part>
  22929.     <part>
  22930.         <id>2</id>
  22931.         <type>button</type>
  22932.         <visible> <true /> </visible>
  22933.         <reserved5> 0 </reserved5>
  22934.         <reserved4> 0 </reserved4>
  22935.         <reserved3> 0 </reserved3>
  22936.         <reserved2> 0 </reserved2>
  22937.         <reserved1> 0 </reserved1>
  22938.         <enabled> <true /> </enabled>
  22939.         <rect>
  22940.             <left>169</left>
  22941.             <top>32</top>
  22942.             <right>305</right>
  22943.             <bottom>54</bottom>
  22944.         </rect>
  22945.         <style>roundrect</style>
  22946.         <showName> <true /> </showName>
  22947.         <highlight> <false /> </highlight>
  22948.         <autoHighlight> <true /> </autoHighlight>
  22949.         <sharedHighlight> <true /> </sharedHighlight>
  22950.         <family>0</family>
  22951.         <titleWidth>0</titleWidth>
  22952.         <icon>0</icon>
  22953.         <textAlign>center</textAlign>
  22954.         <font>Chicago</font>
  22955.         <textSize>12</textSize>
  22956.         <textStyle>plain</textStyle>
  22957.         <name>Copy to Clipboard</name>
  22958.         <script>on mouseUp
  22959. set lockscreen to true
  22960. select text of card field "code"
  22961. domenu "Copy Text"
  22962. select empty
  22963. set lockscreen to false
  22964. end mouseUp</script>
  22965.     </part>
  22966.     <content>
  22967.         <layer>background</layer>
  22968.         <id>4</id>
  22969.         <text>File 4 of 8.
  22970.  
  22971.  
  22972.  
  22973.  
  22974.  
  22975.  
  22976.  
  22977.  
  22978.  
  22979.  
  22980.  
  22981.  
  22982.  
  22983.  
  22984.  
  22985.  
  22986.  
  22987. </text>
  22988.     </content>
  22989.     <content>
  22990.         <layer>background</layer>
  22991.         <id>7</id>
  22992.         <text>243</text>
  22993.     </content>
  22994.     <content>
  22995.         <layer>card</layer>
  22996.         <id>1</id>
  22997.         <text>/*
  22998. *   FILE:       menu.c
  22999. *   AUTHOR:     R. Gonzalez
  23000. *   CREATED:    Feb. 3, 1992
  23001. *
  23002. *   Defines menu methods.
  23003. */
  23004.  
  23005. # include   <string.h>
  23006. # include   <stdlib.h>
  23007. # include   "menu.h"
  23008.  
  23009. static boolean  strsame(char*,char*);
  23010.  
  23011. /*********************************************************************
  23012. *   initialize menu
  23013. *********************************************************************/
  23014. Menu::Menu(void)
  23015. {
  23016.     int     i;
  23017.     
  23018.     num_menus = 0;
  23019.     
  23020.     for (i=1 ; i<=MAX_MENUS ; i++)
  23021.         num_items[i] = 0;
  23022. }
  23023.  
  23024. /*********************************************************************
  23025. *   add command to menu. Space must be allocated statically by calling
  23026. *   routine; e.g., argument may be a constant string like "Quit".
  23027. *   By convention the menu numbers start at 1 while the item numbers
  23028. *   start at 0.  The 0th item in each menu is the menu's heading.
  23029. *   It may be associated with the comfunc: NULL.  Be careful not to
  23030. *   duplicate menu names, nor to exceed the MAX_MENUS and MAX_ITEMS 
  23031. *   limits, nor to leave any "empty" items whose item number is
  23032. *   smaller than num_items[menu_num].
  23033. *********************************************************************/
  23034. boolean Menu::log_command(int menu_num,int item,char *a_command,
  23035.                             comfunc a_command_ptr)
  23036. {
  23037.     boolean     success;
  23038.     
  23039.     if (menu_num <= MAX_MENUS && item <= MAX_ITEMS)
  23040.     {
  23041.         if (menu_num > num_menus)
  23042.             num_menus = menu_num;
  23043.         if (item+1 > num_items[menu_num])
  23044.             num_items[menu_num] = item + 1;
  23045.         command[menu_num][item] = a_command;
  23046.         command_ptr[menu_num][item] = a_command_ptr;
  23047.         success = TRUE;
  23048.     }
  23049.     else
  23050.         success = FALSE;
  23051.     
  23052.     return success;
  23053. }
  23054.  
  23055. /*********************************************************************
  23056. *   get menu number
  23057. *********************************************************************/
  23058. int     Menu::get_menu(char *a_command)
  23059. {
  23060.     int     menu_num,
  23061.             item;
  23062.     boolean done = FALSE;
  23063.             
  23064.     for (menu_num=1 ; menu_num <= num_menus && !done ; menu_num++)
  23065.         for (item=1 ; item < num_items[menu_num] && !done ; item++)
  23066.             if (strsame(command[menu_num][item],a_command))
  23067.                 done = TRUE;
  23068.     
  23069.     if (done)
  23070.         return menu_num-1;
  23071.     else
  23072.         return ILLEGAL;
  23073. }
  23074.  
  23075. /*********************************************************************
  23076. *   get item number
  23077. *********************************************************************/
  23078. int     Menu::get_item(char *a_command)
  23079. {
  23080.     int     menu_num,
  23081.             item;
  23082.     boolean done = FALSE;
  23083.             
  23084.     for (menu_num=1 ; menu_num <= num_menus && !done ; menu_num++)
  23085.         for (item=1 ; item < num_items[menu_num] && !done ; item++)
  23086.             if (strsame(command[menu_num][item],a_command))
  23087.                 done = TRUE;
  23088.     
  23089.     if (done)
  23090.         return item-1;
  23091.     else
  23092.         return ILLEGAL;
  23093. }
  23094.  
  23095. /*********************************************************************
  23096. *   get pointer to command function associated with menu_num and item.
  23097. *********************************************************************/
  23098. comfunc     Menu::get_command_ptr(int menu_num,int item)
  23099. {
  23100.     if (menu_num < 1 || menu_num > num_menus)
  23101.         return NULL;
  23102.     else if (item < 1 || item >= num_items[menu_num])
  23103.         return NULL;
  23104.     else
  23105.         return command_ptr[menu_num][item];
  23106. }
  23107.  
  23108. /*--------------------------- functions ----------------------------*/
  23109.  
  23110. /*********************************************************************
  23111. *   caseless version of strcmp() - only compares up to length of s2.
  23112. *   ascii only.
  23113. *********************************************************************/
  23114. boolean     strsame(char *s1,char *s2)
  23115. {
  23116.     int     i;
  23117.     char    c1,
  23118.             c2;
  23119.     boolean equal = TRUE;
  23120.     
  23121.     if (strlen(s1) < strlen(s2))
  23122.         equal = FALSE;
  23123.     else
  23124.         for (i=0 ; i<strlen(s2) ; i++)
  23125.         {
  23126.             if (s1[i] > 64 && s1[i] < 91)
  23127.                 c1 = s1[i] + 32;        // convert to lower-case 
  23128.             else
  23129.                 c1 = s1[i];
  23130.             if (s2[i] > 64 && s2[i] < 91)
  23131.                 c2 = s2[i] + 32;        // convert to lower-case 
  23132.             else
  23133.                 c2 = s2[i];
  23134.             if (c1 != c2)
  23135.                 equal = FALSE;
  23136.         }
  23137.     
  23138.     return equal;
  23139. }
  23140.  
  23141. </text>
  23142.     </content>
  23143.     <name></name>
  23144.     <script></script>
  23145. </card>
  23146.  
  23147.  
  23148. card_61092.xml
  23149. <?xml version="1.0" encoding="utf-8" ?>
  23150. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  23151. <card>
  23152.     <id>61092</id>
  23153.     <filler1>0</filler1>
  23154.     <cantDelete> <false /> </cantDelete>
  23155.     <showPict> <true /> </showPict>
  23156.     <dontSearch> <false /> </dontSearch>
  23157.     <owner>4755</owner>
  23158.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  23159.     <part>
  23160.         <id>1</id>
  23161.         <type>field</type>
  23162.         <visible> <true /> </visible>
  23163.         <dontWrap> <false /> </dontWrap>
  23164.         <dontSearch> <false /> </dontSearch>
  23165.         <sharedText> <false /> </sharedText>
  23166.         <fixedLineHeight> <true /> </fixedLineHeight>
  23167.         <autoTab> <false /> </autoTab>
  23168.         <lockText> <false /> </lockText>
  23169.         <rect>
  23170.             <left>30</left>
  23171.             <top>78</top>
  23172.             <right>478</right>
  23173.             <bottom>296</bottom>
  23174.         </rect>
  23175.         <style>scrolling</style>
  23176.         <autoSelect> <false /> </autoSelect>
  23177.         <showLines> <false /> </showLines>
  23178.         <wideMargins> <false /> </wideMargins>
  23179.         <multipleLines> <false /> </multipleLines>
  23180.         <reservedFamily> 0 </reservedFamily>
  23181.         <titleWidth>0</titleWidth>
  23182.         <icon>0</icon>
  23183.         <textAlign>left</textAlign>
  23184.         <font>Monaco</font>
  23185.         <textSize>9</textSize>
  23186.         <textStyle>plain</textStyle>
  23187.         <textHeight>12</textHeight>
  23188.         <name>code</name>
  23189.         <script></script>
  23190.     </part>
  23191.     <part>
  23192.         <id>2</id>
  23193.         <type>button</type>
  23194.         <visible> <true /> </visible>
  23195.         <reserved5> 0 </reserved5>
  23196.         <reserved4> 0 </reserved4>
  23197.         <reserved3> 0 </reserved3>
  23198.         <reserved2> 0 </reserved2>
  23199.         <reserved1> 0 </reserved1>
  23200.         <enabled> <true /> </enabled>
  23201.         <rect>
  23202.             <left>169</left>
  23203.             <top>32</top>
  23204.             <right>305</right>
  23205.             <bottom>54</bottom>
  23206.         </rect>
  23207.         <style>roundrect</style>
  23208.         <showName> <true /> </showName>
  23209.         <highlight> <false /> </highlight>
  23210.         <autoHighlight> <true /> </autoHighlight>
  23211.         <sharedHighlight> <true /> </sharedHighlight>
  23212.         <family>0</family>
  23213.         <titleWidth>0</titleWidth>
  23214.         <icon>0</icon>
  23215.         <textAlign>center</textAlign>
  23216.         <font>Chicago</font>
  23217.         <textSize>12</textSize>
  23218.         <textStyle>plain</textStyle>
  23219.         <name>Copy to Clipboard</name>
  23220.         <script>on mouseUp
  23221. set lockscreen to true
  23222. select text of card field "code"
  23223. domenu "Copy Text"
  23224. select empty
  23225. set lockscreen to false
  23226. end mouseUp</script>
  23227.     </part>
  23228.     <content>
  23229.         <layer>background</layer>
  23230.         <id>4</id>
  23231.         <text>File 5 of 8.</text>
  23232.     </content>
  23233.     <content>
  23234.         <layer>background</layer>
  23235.         <id>7</id>
  23236.         <text>244</text>
  23237.     </content>
  23238.     <content>
  23239.         <layer>card</layer>
  23240.         <id>1</id>
  23241.         <text>/*
  23242. *   FILE:       dataapp.h
  23243. *   AUTHOR:     R. Gonzalez
  23244. *   CREATED:    Feb. 3, 1992
  23245. *
  23246. *   Database example used to test application framework.
  23247. */
  23248.  
  23249. # ifndef    dataapp_h
  23250. # define    dataapp_h
  23251.  
  23252. # include   "app.h"
  23253. # include   "dfile.h"
  23254.  
  23255. /*********************************************************************
  23256. *   test application.
  23257. *********************************************************************/
  23258. class   Data_App:public Generic_App
  23259. {
  23260. private:
  23261.     static Dfile    *dfile;
  23262.     static boolean  newfil(void);
  23263.     static boolean  oopen(void);
  23264.     static boolean  save(void);
  23265.     static boolean  quit(void);
  23266.     static boolean  enter_data(void);
  23267.     static boolean  list_data(void);
  23268.     static boolean  sort_by_name(void);
  23269.     static boolean  sort_by_age(void);
  23270.     static boolean  report_filename(void);
  23271.  
  23272. public:
  23273.     Data_App(void);
  23274.     virtual ~Data_App(void);
  23275. };
  23276.  
  23277. # endif
  23278.  
  23279. </text>
  23280.     </content>
  23281.     <name></name>
  23282.     <script></script>
  23283. </card>
  23284.  
  23285.  
  23286. card_62692.xml
  23287. <?xml version="1.0" encoding="utf-8" ?>
  23288. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  23289. <card>
  23290.     <id>62692</id>
  23291.     <filler1>0</filler1>
  23292.     <cantDelete> <false /> </cantDelete>
  23293.     <showPict> <true /> </showPict>
  23294.     <dontSearch> <false /> </dontSearch>
  23295.     <owner>4755</owner>
  23296.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  23297.     <part>
  23298.         <id>1</id>
  23299.         <type>field</type>
  23300.         <visible> <true /> </visible>
  23301.         <dontWrap> <false /> </dontWrap>
  23302.         <dontSearch> <false /> </dontSearch>
  23303.         <sharedText> <false /> </sharedText>
  23304.         <fixedLineHeight> <true /> </fixedLineHeight>
  23305.         <autoTab> <false /> </autoTab>
  23306.         <lockText> <false /> </lockText>
  23307.         <rect>
  23308.             <left>30</left>
  23309.             <top>78</top>
  23310.             <right>478</right>
  23311.             <bottom>296</bottom>
  23312.         </rect>
  23313.         <style>scrolling</style>
  23314.         <autoSelect> <false /> </autoSelect>
  23315.         <showLines> <false /> </showLines>
  23316.         <wideMargins> <false /> </wideMargins>
  23317.         <multipleLines> <false /> </multipleLines>
  23318.         <reservedFamily> 0 </reservedFamily>
  23319.         <titleWidth>0</titleWidth>
  23320.         <icon>0</icon>
  23321.         <textAlign>left</textAlign>
  23322.         <font>Monaco</font>
  23323.         <textSize>9</textSize>
  23324.         <textStyle>plain</textStyle>
  23325.         <textHeight>12</textHeight>
  23326.         <name>code</name>
  23327.         <script></script>
  23328.     </part>
  23329.     <part>
  23330.         <id>2</id>
  23331.         <type>button</type>
  23332.         <visible> <true /> </visible>
  23333.         <reserved5> 0 </reserved5>
  23334.         <reserved4> 0 </reserved4>
  23335.         <reserved3> 0 </reserved3>
  23336.         <reserved2> 0 </reserved2>
  23337.         <reserved1> 0 </reserved1>
  23338.         <enabled> <true /> </enabled>
  23339.         <rect>
  23340.             <left>169</left>
  23341.             <top>32</top>
  23342.             <right>305</right>
  23343.             <bottom>54</bottom>
  23344.         </rect>
  23345.         <style>roundrect</style>
  23346.         <showName> <true /> </showName>
  23347.         <highlight> <false /> </highlight>
  23348.         <autoHighlight> <true /> </autoHighlight>
  23349.         <sharedHighlight> <true /> </sharedHighlight>
  23350.         <family>0</family>
  23351.         <titleWidth>0</titleWidth>
  23352.         <icon>0</icon>
  23353.         <textAlign>center</textAlign>
  23354.         <font>Chicago</font>
  23355.         <textSize>12</textSize>
  23356.         <textStyle>plain</textStyle>
  23357.         <name>Copy to Clipboard</name>
  23358.         <script>on mouseUp
  23359. set lockscreen to true
  23360. select text of card field "code"
  23361. domenu "Copy Text"
  23362. select empty
  23363. set lockscreen to false
  23364. end mouseUp</script>
  23365.     </part>
  23366.     <content>
  23367.         <layer>background</layer>
  23368.         <id>4</id>
  23369.         <text>File 6 of 8.</text>
  23370.     </content>
  23371.     <content>
  23372.         <layer>background</layer>
  23373.         <id>7</id>
  23374.         <text>245</text>
  23375.     </content>
  23376.     <content>
  23377.         <layer>card</layer>
  23378.         <id>1</id>
  23379.         <text>/*
  23380. *   FILE:       dataapp.c
  23381. *   AUTHOR:     R. Gonzalez
  23382. *   CREATED:    Feb. 3, 1992
  23383. *
  23384. *   Defines simple database application commands, main function.
  23385. *
  23386. *   ASSOCIATED FILES:
  23387. *       app.c,app.h,class.c,class.h,menu.c,menu.h,
  23388. *       dfile.c,dfile.h,dataapp.h.
  23389. *
  23390. *   PROJECT CONTENTS (Think C):
  23391. *       above-listed source (.c) files, ANSI, oops libraries.
  23392. */
  23393.  
  23394. # include   <string.h>
  23395. # include   <stdio.h>
  23396. # include   "dataapp.h"
  23397.  
  23398. # define    MAX_LENGTH  80
  23399.  
  23400. Dfile*  Data_App::dfile;
  23401. static int  get_line(char[],int);
  23402.  
  23403. /*********************************************************************
  23404. *   initialize database application
  23405. *********************************************************************/
  23406. Data_App::Data_App(void)
  23407. {
  23408.     menu->log_command(1,0,"File",NULL);
  23409.     menu->log_command(1,1,"New",(comfunc) newfil);
  23410.     menu->log_command(1,2,"Open",(comfunc) oopen);
  23411.     menu->log_command(1,3,"Save",(comfunc) save);
  23412.     menu->log_command(1,4,"Quit",(comfunc) Generic_App::quit);
  23413.     menu->log_command(2,0,"Data",NULL);
  23414.     menu->log_command(2,1,"Enter",(comfunc) enter_data);
  23415.     menu->log_command(2,2,"List",(comfunc) list_data);
  23416.     menu->log_command(3,0,"Options",NULL);
  23417.     menu->log_command(3,1,"SortByName",(comfunc) sort_by_name);
  23418.     menu->log_command(3,2,"SortByAge",(comfunc) sort_by_age);
  23419.  
  23420.     menu->log_command(1,5,"Bye",(comfunc) Generic_App::quit);
  23421.     menu->log_command(1,6,"Exit",(comfunc) Generic_App::quit);
  23422.     menu->log_command(1,7,"SeeYouLaterAlligator",(comfunc) Generic_App::quit);
  23423.  
  23424.     dfile = new Dfile;
  23425.     initialized = initialized &&
  23426.         (dfile != NULL) && dfile->is_initialized();
  23427. }
  23428.  
  23429. /*********************************************************************
  23430. *   terminate application - free up allocated space.
  23431. *********************************************************************/
  23432. Data_App::~Data_App(void)
  23433. {
  23434.     delete dfile;
  23435. }
  23436.  
  23437. /*---------------------------- commands ----------------------------*/
  23438.  
  23439. /*********************************************************************
  23440. *   clear database memory.
  23441. *********************************************************************/
  23442. boolean Data_App::newfil(void)
  23443. {
  23444.     printf("Clearing data...\n");
  23445.     return dfile->clear();
  23446. }
  23447.  
  23448. /*********************************************************************
  23449. *   open record file.  For some reason there was a conflict with the
  23450. *   name "open" so I used "oopen".
  23451. *********************************************************************/
  23452. boolean Data_App::oopen(void)
  23453. {
  23454.     char    temp_char[MAX_LENGTH];
  23455.  
  23456.     printf("Enter file name:\n");
  23457.     get_line(temp_char,MAX_LENGTH);
  23458.     
  23459.     if (!dfile->open_existing(temp_char))
  23460.         printf("No such file.\n");
  23461.     
  23462.     return TRUE;
  23463. }
  23464.  
  23465. /*********************************************************************
  23466. *   save records.
  23467. *********************************************************************/
  23468. boolean Data_App::save(void)
  23469. {
  23470.     char    temp_char[MAX_LENGTH];
  23471.     
  23472.     printf("Enter file name (RETURN for previous):\n");
  23473.     get_line(temp_char,MAX_LENGTH);
  23474.     
  23475.     if (!dfile->write_valid(temp_char))
  23476.         printf("Can't open file.\n");
  23477.     
  23478.     return TRUE;
  23479. }
  23480.  
  23481. /*********************************************************************
  23482. *   enter data record.
  23483. *********************************************************************/
  23484. boolean Data_App::enter_data(void)
  23485. {
  23486.     boolean success;
  23487.     char    *question1 = "Enter your name: ",
  23488.             *question2 = "Enter your age: ",
  23489.             answer1[MAX_LENGTH],
  23490.             answer2[MAX_LENGTH];
  23491.     
  23492.     printf("Enter a name:\n");
  23493.     get_line(answer1,MAX_LENGTH);
  23494.     printf("Enter an age:\n");
  23495.     get_line(answer2,MAX_LENGTH);
  23496.     
  23497.     if (strcmp(answer1,"") != 0 || strcmp(answer2,"") != 0)
  23498.     {
  23499.         success = TRUE;
  23500.         if (!dfile->add_record(answer1,answer2))
  23501.             printf("Too many records.\n");
  23502.     }
  23503.     else
  23504.         success = FALSE;
  23505.     
  23506.     return success;
  23507. }
  23508.  
  23509. /*********************************************************************
  23510. *   list data records.
  23511. *********************************************************************/
  23512. boolean Data_App::list_data(void)
  23513. {
  23514.     int     i=0;
  23515.     char    response[MAX_LENGTH];
  23516.     
  23517.     while (dfile->get_record(i++,response))
  23518.         printf("%s\n",response);
  23519.         
  23520.     if (i == 1)
  23521.         printf("No entries.\n");
  23522.     
  23523.     return TRUE;
  23524. }
  23525.  
  23526. /*********************************************************************
  23527. *   sort by name.
  23528. *********************************************************************/
  23529. boolean Data_App::sort_by_name(void)
  23530. {
  23531.     return dfile->sort_by_name();
  23532. }
  23533.  
  23534. /*********************************************************************
  23535. *   sort by age.
  23536. *********************************************************************/
  23537. boolean Data_App::sort_by_age(void)
  23538. {
  23539.     return dfile->sort_by_age();
  23540. }
  23541.  
  23542. /*----------------------------- functions --------------------------*/
  23543.  
  23544. /*********************************************************************
  23545. *   Usual function to get line from std input.  Returns number of
  23546. *   chars read or EOF.
  23547. *********************************************************************/
  23548. int     get_line(char line[],int max_length)
  23549. {
  23550.     int     c,
  23551.             i=0;
  23552.             
  23553.     while (((c = getchar()) != '\n') && c != EOF)
  23554.         if (i < max_length - 1)
  23555.             line[i++] = c;
  23556.     
  23557.     line[i] = '\0';
  23558.     
  23559.     if (c == EOF)
  23560.         return EOF;
  23561.     else
  23562.         return i;
  23563. }
  23564.  
  23565. /*********************************************************************
  23566. *   main - you found it!
  23567. *********************************************************************/
  23568. main()
  23569. {
  23570.     Generic_App     *application;
  23571.  
  23572.     application = new Data_App;
  23573.     
  23574.     if (application->is_initialized())
  23575.         application->run();
  23576.         
  23577.     delete application;
  23578. }
  23579.  
  23580. </text>
  23581.     </content>
  23582.     <name></name>
  23583.     <script></script>
  23584. </card>
  23585.  
  23586.  
  23587. card_63086.xml
  23588. <?xml version="1.0" encoding="utf-8" ?>
  23589. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  23590. <card>
  23591.     <id>63086</id>
  23592.     <filler1>0</filler1>
  23593.     <cantDelete> <false /> </cantDelete>
  23594.     <showPict> <true /> </showPict>
  23595.     <dontSearch> <false /> </dontSearch>
  23596.     <owner>4755</owner>
  23597.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  23598.     <part>
  23599.         <id>1</id>
  23600.         <type>field</type>
  23601.         <visible> <true /> </visible>
  23602.         <dontWrap> <false /> </dontWrap>
  23603.         <dontSearch> <false /> </dontSearch>
  23604.         <sharedText> <false /> </sharedText>
  23605.         <fixedLineHeight> <true /> </fixedLineHeight>
  23606.         <autoTab> <false /> </autoTab>
  23607.         <lockText> <false /> </lockText>
  23608.         <rect>
  23609.             <left>30</left>
  23610.             <top>78</top>
  23611.             <right>478</right>
  23612.             <bottom>296</bottom>
  23613.         </rect>
  23614.         <style>scrolling</style>
  23615.         <autoSelect> <false /> </autoSelect>
  23616.         <showLines> <false /> </showLines>
  23617.         <wideMargins> <false /> </wideMargins>
  23618.         <multipleLines> <false /> </multipleLines>
  23619.         <reservedFamily> 0 </reservedFamily>
  23620.         <titleWidth>0</titleWidth>
  23621.         <icon>0</icon>
  23622.         <textAlign>left</textAlign>
  23623.         <font>Monaco</font>
  23624.         <textSize>9</textSize>
  23625.         <textStyle>plain</textStyle>
  23626.         <textHeight>12</textHeight>
  23627.         <name>code</name>
  23628.         <script></script>
  23629.     </part>
  23630.     <part>
  23631.         <id>2</id>
  23632.         <type>button</type>
  23633.         <visible> <true /> </visible>
  23634.         <reserved5> 0 </reserved5>
  23635.         <reserved4> 0 </reserved4>
  23636.         <reserved3> 0 </reserved3>
  23637.         <reserved2> 0 </reserved2>
  23638.         <reserved1> 0 </reserved1>
  23639.         <enabled> <true /> </enabled>
  23640.         <rect>
  23641.             <left>169</left>
  23642.             <top>32</top>
  23643.             <right>305</right>
  23644.             <bottom>54</bottom>
  23645.         </rect>
  23646.         <style>roundrect</style>
  23647.         <showName> <true /> </showName>
  23648.         <highlight> <false /> </highlight>
  23649.         <autoHighlight> <true /> </autoHighlight>
  23650.         <sharedHighlight> <true /> </sharedHighlight>
  23651.         <family>0</family>
  23652.         <titleWidth>0</titleWidth>
  23653.         <icon>0</icon>
  23654.         <textAlign>center</textAlign>
  23655.         <font>Chicago</font>
  23656.         <textSize>12</textSize>
  23657.         <textStyle>plain</textStyle>
  23658.         <name>Copy to Clipboard</name>
  23659.         <script>on mouseUp
  23660. set lockscreen to true
  23661. select text of card field "code"
  23662. domenu "Copy Text"
  23663. select empty
  23664. set lockscreen to false
  23665. end mouseUp</script>
  23666.     </part>
  23667.     <content>
  23668.         <layer>background</layer>
  23669.         <id>4</id>
  23670.         <text>File 7 of 8.</text>
  23671.     </content>
  23672.     <content>
  23673.         <layer>background</layer>
  23674.         <id>7</id>
  23675.         <text>246</text>
  23676.     </content>
  23677.     <content>
  23678.         <layer>card</layer>
  23679.         <id>1</id>
  23680.         <text>/*
  23681. *   FILE:       dfile.h
  23682. *   AUTHOR:     R. Gonzalez
  23683. *   CREATED:    Feb. 3, 1992
  23684. *
  23685. *   Defines file class for database application.
  23686. */
  23687.  
  23688. # ifndef    dfile_h
  23689. # define    dfile_h
  23690.  
  23691. # include   "class.h"
  23692. # define    MAX_DATA    50
  23693.  
  23694. /*********************************************************************
  23695. *   database file
  23696. *********************************************************************/
  23697. class   Dfile:public Generic_Class
  23698. {
  23699. private:
  23700.     char            *name[MAX_DATA];
  23701.     char            *age[MAX_DATA];
  23702.     int             num_data;
  23703.     char            *filename;
  23704.  
  23705. public:
  23706.     Dfile(void);
  23707.     virtual boolean clear(void);
  23708.     virtual boolean open_existing(char*);
  23709.     virtual boolean write_valid(char*);
  23710.     virtual boolean add_record(char*,char*);
  23711.     virtual boolean get_record(int,char*);
  23712.     virtual boolean sort_by_name(void);
  23713.     virtual boolean sort_by_age(void);
  23714.     virtual ~Dfile(void);
  23715. };
  23716.  
  23717. # endif
  23718. </text>
  23719.     </content>
  23720.     <name></name>
  23721.     <script></script>
  23722. </card>
  23723.  
  23724.  
  23725. card_64165.xml
  23726. <?xml version="1.0" encoding="utf-8" ?>
  23727. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  23728. <card>
  23729.     <id>64165</id>
  23730.     <filler1>0</filler1>
  23731.     <cantDelete> <false /> </cantDelete>
  23732.     <showPict> <true /> </showPict>
  23733.     <dontSearch> <false /> </dontSearch>
  23734.     <owner>4755</owner>
  23735.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  23736.     <part>
  23737.         <id>1</id>
  23738.         <type>field</type>
  23739.         <visible> <true /> </visible>
  23740.         <dontWrap> <false /> </dontWrap>
  23741.         <dontSearch> <false /> </dontSearch>
  23742.         <sharedText> <false /> </sharedText>
  23743.         <fixedLineHeight> <true /> </fixedLineHeight>
  23744.         <autoTab> <false /> </autoTab>
  23745.         <lockText> <false /> </lockText>
  23746.         <rect>
  23747.             <left>30</left>
  23748.             <top>78</top>
  23749.             <right>478</right>
  23750.             <bottom>296</bottom>
  23751.         </rect>
  23752.         <style>scrolling</style>
  23753.         <autoSelect> <false /> </autoSelect>
  23754.         <showLines> <false /> </showLines>
  23755.         <wideMargins> <false /> </wideMargins>
  23756.         <multipleLines> <false /> </multipleLines>
  23757.         <reservedFamily> 0 </reservedFamily>
  23758.         <titleWidth>0</titleWidth>
  23759.         <icon>0</icon>
  23760.         <textAlign>left</textAlign>
  23761.         <font>Monaco</font>
  23762.         <textSize>9</textSize>
  23763.         <textStyle>plain</textStyle>
  23764.         <textHeight>12</textHeight>
  23765.         <name>code</name>
  23766.         <script></script>
  23767.     </part>
  23768.     <part>
  23769.         <id>2</id>
  23770.         <type>button</type>
  23771.         <visible> <true /> </visible>
  23772.         <reserved5> 0 </reserved5>
  23773.         <reserved4> 0 </reserved4>
  23774.         <reserved3> 0 </reserved3>
  23775.         <reserved2> 0 </reserved2>
  23776.         <reserved1> 0 </reserved1>
  23777.         <enabled> <true /> </enabled>
  23778.         <rect>
  23779.             <left>169</left>
  23780.             <top>32</top>
  23781.             <right>305</right>
  23782.             <bottom>54</bottom>
  23783.         </rect>
  23784.         <style>roundrect</style>
  23785.         <showName> <true /> </showName>
  23786.         <highlight> <false /> </highlight>
  23787.         <autoHighlight> <true /> </autoHighlight>
  23788.         <sharedHighlight> <true /> </sharedHighlight>
  23789.         <family>0</family>
  23790.         <titleWidth>0</titleWidth>
  23791.         <icon>0</icon>
  23792.         <textAlign>center</textAlign>
  23793.         <font>Chicago</font>
  23794.         <textSize>12</textSize>
  23795.         <textStyle>plain</textStyle>
  23796.         <name>Copy to Clipboard</name>
  23797.         <script>on mouseUp
  23798. set lockscreen to true
  23799. select text of card field "code"
  23800. domenu "Copy Text"
  23801. select empty
  23802. set lockscreen to false
  23803. end mouseUp</script>
  23804.     </part>
  23805.     <content>
  23806.         <layer>background</layer>
  23807.         <id>4</id>
  23808.         <text>File 8 of 8.</text>
  23809.     </content>
  23810.     <content>
  23811.         <layer>background</layer>
  23812.         <id>7</id>
  23813.         <text>247</text>
  23814.     </content>
  23815.     <content>
  23816.         <layer>card</layer>
  23817.         <id>1</id>
  23818.         <text>/*
  23819. *   FILE:       dfile.c
  23820. *   AUTHOR:     R. Gonzalez
  23821. *   CREATED:    Feb. 3, 1992
  23822. *
  23823. *   Defines simple database file access methods.
  23824. */
  23825.  
  23826. # include   "dfile.h"
  23827. # include   <stdlib.h>
  23828. # include   <string.h>
  23829. # include   <stdio.h>
  23830.  
  23831. # define    MAX_LENGTH  80
  23832. static int  fget_line(FILE*,char[],int);
  23833. static int  strtoint(char*);
  23834.  
  23835. /*********************************************************************
  23836. *   initialize
  23837. *********************************************************************/
  23838. Dfile::Dfile(void)
  23839. {
  23840.     filename = NULL;
  23841.     num_data = 0;
  23842. }
  23843.  
  23844. /*********************************************************************
  23845. *   clear (like destructor+constructor)
  23846. *********************************************************************/
  23847. boolean Dfile::clear(void)
  23848. {
  23849.     int     i;
  23850.     
  23851.     for (i=0 ; i<num_data ; i++)
  23852.     {
  23853.         free(name[i]);
  23854.         free(age[i]);
  23855.     }
  23856.     
  23857.     free(filename);
  23858.  
  23859.     filename = NULL;
  23860.     num_data = 0;
  23861.     
  23862.     return initialized;
  23863. }
  23864.  
  23865. /*********************************************************************
  23866. *   open existing file
  23867. *********************************************************************/
  23868. boolean Dfile::open_existing(char *filename_val)
  23869. {
  23870.     boolean success;
  23871.     int     temp_int,
  23872.             i;
  23873.     char    temp_char[MAX_LENGTH],
  23874.             junk;
  23875.     FILE    *file;
  23876.     
  23877.     if ((file = fopen(filename_val,"r")) == NULL)
  23878.         success = FALSE;
  23879.     else
  23880.     {
  23881.         success = TRUE;
  23882.         clear();
  23883.         // is it right that Turbo C++ requires me to cast malloc's
  23884.         //  return value here and later in this file? 
  23885.         filename = (char*) malloc(sizeof(char) *
  23886.             (strlen(filename_val)+1));
  23887.         strcpy(filename,filename_val);
  23888.         fscanf(file,"%d",&temp_int);
  23889.         junk = fgetc(file);
  23890.         num_data = temp_int;    // "shadowing" for Think C 
  23891.         for (i=0 ; i<num_data ; i++)
  23892.         {
  23893.             fget_line(file,temp_char,MAX_LENGTH);
  23894.             name[i] = (char*) malloc(sizeof(char) *
  23895.                 (strlen(temp_char)+1));
  23896.             strcpy(name[i],temp_char);
  23897.             fget_line(file,temp_char,MAX_LENGTH);
  23898.             age[i] = (char*) malloc(sizeof(char) *
  23899.                 (strlen(temp_char)+1));
  23900.             strcpy(age[i],temp_char);
  23901.         }
  23902.         fclose(file);
  23903.     }
  23904.     
  23905.     return success;
  23906. }
  23907.  
  23908. /*********************************************************************
  23909. *   write to a valid file
  23910. *********************************************************************/
  23911. boolean Dfile::write_valid(char *filename_val)
  23912. {
  23913.     int     i;
  23914.     FILE    *file;
  23915.     boolean success;
  23916.     
  23917.     if (strcmp(filename_val,"") != 0)
  23918.     {
  23919.         file = fopen(filename_val,"w");
  23920.         if (filename != NULL)
  23921.             free(filename);
  23922.         filename = (char*) malloc(sizeof(char) *
  23923.             (strlen(filename_val)+1));
  23924.         strcpy(filename,filename_val);
  23925.     }
  23926.     else
  23927.     {
  23928.         if (filename != NULL)
  23929.             file = fopen(filename,"w");
  23930.         else
  23931.             file = NULL;
  23932.     }
  23933.             
  23934.     if (file == NULL)
  23935.         success = FALSE;
  23936.     else
  23937.     {
  23938.         success = TRUE;
  23939.         fprintf(file,"%d\n",num_data);
  23940.         for (i=0 ; i<num_data ; i++)
  23941.         {
  23942.             fprintf(file,"%s\n",name[i]);
  23943.             fprintf(file,"%s\n",age[i]);
  23944.         }
  23945.         
  23946.         fclose(file);
  23947.     }
  23948.     
  23949.     return success;
  23950. }
  23951.  
  23952. /*********************************************************************
  23953. *   add a record
  23954. *********************************************************************/
  23955. boolean Dfile::add_record(char *name_val,char *age_val)
  23956. {
  23957.     boolean success;
  23958.     
  23959.     if (num_data+1 < MAX_DATA)
  23960.     {
  23961.         success = TRUE;
  23962.         name[num_data] = (char*) malloc(sizeof(char) *
  23963.             (strlen(name_val)+1));
  23964.         strcpy(name[num_data],name_val);
  23965.         age[num_data] = (char*) malloc(sizeof(char) *
  23966.             (strlen(age_val)+1));
  23967.         strcpy(age[num_data],age_val);
  23968.         num_data++;
  23969.     }
  23970.     else
  23971.         success = FALSE;
  23972.     
  23973.     return success;
  23974. }
  23975.  
  23976. /*********************************************************************
  23977. *   get a record
  23978. *********************************************************************/
  23979. boolean Dfile::get_record(int record_no,char *record)
  23980. {
  23981.     boolean success;
  23982.     
  23983.     if (record_no >= num_data)
  23984.         success = FALSE;
  23985.     else
  23986.     {
  23987.         success = TRUE;
  23988.         strcpy(record,name[record_no]);
  23989.         strcat(record,", ");
  23990.         strcat(record,age[record_no]);
  23991.     }
  23992.     
  23993.     return success;
  23994. }
  23995.  
  23996. /*********************************************************************
  23997. *   sort database by name.  This would probably be a lot more
  23998. *   efficient if you used a linked-list!
  23999. *********************************************************************/
  24000. boolean Dfile::sort_by_name(void)
  24001. {
  24002.     int     i,
  24003.             j;
  24004.     char    temp[MAX_LENGTH];
  24005.     
  24006.     for (i=0 ; i<num_data ; i++)
  24007.         for (j=i ; j<num_data ; j++)
  24008.         {
  24009.             if (strcmp(name[i],name[j]) > 0)
  24010.             {
  24011.                 strcpy(temp,name[i]);
  24012.                 free(name[i]);
  24013.                 name[i] = (char*) malloc(sizeof(char) *
  24014.                     (strlen(name[j])+1));
  24015.                 strcpy(name[i],name[j]);
  24016.                 free(name[j]);
  24017.                 name[j] = (char*) malloc(sizeof(char) *
  24018.                     (strlen(temp)+1));
  24019.                 strcpy(name[j],temp);
  24020.                 strcpy(temp,age[i]);
  24021.                 free(age[i]);
  24022.                 age[i] = (char*) malloc(sizeof(char) *
  24023.                     (strlen(age[j])+1));
  24024.                 strcpy(age[i],age[j]);
  24025.                 free(age[j]);
  24026.                 age[j] = (char*) malloc(sizeof(char) *
  24027.                     (strlen(temp)+1));
  24028.                 strcpy(age[j],temp);
  24029.             }
  24030.         }
  24031.     
  24032.     return TRUE;
  24033. }
  24034.  
  24035. /*********************************************************************
  24036. *   sort database by age.  See comment above.
  24037. *********************************************************************/
  24038. boolean Dfile::sort_by_age(void)
  24039. {
  24040.     int     i,
  24041.             j;
  24042.     char    temp[MAX_LENGTH];
  24043.     
  24044.     for (i=0 ; i<num_data ; i++)
  24045.         for (j=i ; j<num_data ; j++)
  24046.         {
  24047.             if (strtoint(age[i]) > strtoint(age[j]))
  24048.             {
  24049.                 strcpy(temp,name[i]);
  24050.                 free(name[i]);
  24051.                 name[i] = (char*) malloc(sizeof(char) *
  24052.                     (strlen(name[j])+1));
  24053.                 strcpy(name[i],name[j]);
  24054.                 free(name[j]);
  24055.                 name[j] = (char*) malloc(sizeof(char) *
  24056.                     (strlen(temp)+1));
  24057.                 strcpy(name[j],temp);
  24058.                 strcpy(temp,age[i]);
  24059.                 free(age[i]);
  24060.                 age[i] = (char*) malloc(sizeof(char) *
  24061.                     (strlen(age[j])+1));
  24062.                 strcpy(age[i],age[j]);
  24063.                 free(age[j]);
  24064.                 age[j] = (char*) malloc(sizeof(char) *
  24065.                     (strlen(temp)+1));
  24066.                 strcpy(age[j],temp);
  24067.             }
  24068.         }
  24069.     
  24070.     return TRUE;
  24071. }
  24072.  
  24073. /*********************************************************************
  24074. *   dispose
  24075. *********************************************************************/
  24076. Dfile::~Dfile(void)
  24077. {
  24078.     int     i;
  24079.     
  24080.     for (i=0 ; i<num_data ; i++)
  24081.     {
  24082.         free(name[i]);
  24083.         free(age[i]);
  24084.     }
  24085.     
  24086.     free(filename);
  24087. }
  24088.  
  24089. /*---------------------------- functions ---------------------------*/
  24090.  
  24091. /*********************************************************************
  24092. *   Usual function to get line from file.  Returns number of chars
  24093. *   read or EOF.
  24094. *********************************************************************/
  24095. int     fget_line(FILE *file,char line[],int max_length)
  24096. {
  24097.     int     c,
  24098.             i=0;
  24099.             
  24100.     while (((c = fgetc(file)) != '\n') && c != EOF)
  24101.         if (i < max_length - 1)
  24102.             line[i++] = c;
  24103.     
  24104.     line[i] = '\0';
  24105.     
  24106.     if (c == EOF)
  24107.         return EOF;
  24108.     else
  24109.         return i;
  24110. }
  24111.  
  24112. /*********************************************************************
  24113. *   converts string to integer.  ascii only.
  24114. *********************************************************************/
  24115. int     strtoint(char *s)
  24116. {
  24117.     int     i = 0,
  24118.             result = 0;
  24119.     
  24120.     while (s[i] == ' ')
  24121.         i++;                // strip leading spaces 
  24122.     
  24123.     while (s[i] > 47 && s[i] < 58)
  24124.     {
  24125.         result = result*10 + s[i] - 48;
  24126.         i++;
  24127.     }
  24128.         
  24129.     return result;
  24130. }
  24131.  
  24132. </text>
  24133.     </content>
  24134.     <name></name>
  24135.     <script></script>
  24136. </card>
  24137.  
  24138.  
  24139. card_3295.xml
  24140. <?xml version="1.0" encoding="utf-8" ?>
  24141. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24142. <card>
  24143.     <id>3295</id>
  24144.     <filler1>0</filler1>
  24145.     <cantDelete> <false /> </cantDelete>
  24146.     <showPict> <true /> </showPict>
  24147.     <dontSearch> <false /> </dontSearch>
  24148.     <owner>4755</owner>
  24149.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24150.     <content>
  24151.         <layer>background</layer>
  24152.         <id>4</id>
  24153.         <text><span class="style3">hink C is an integrated editor-compiler-linker-debugger environment.  During development the user's program is maintained in a </span><span class="style7">project</span><span class="style3"> file, whose name is normally given the œÄ (pi) symbol extension, Option-P in Geneva font.  This file keeps track of all the source files, header files, and libraries which make up the program, and also stores the object code for all the files which have compiled successfully.  The project file, headers, and sources are usually kept together in a folder.
  24154.  
  24155. Similar to the UNIX "make" utility, Think C decides which source files will require recompilation due to changes to source or header files.
  24156.  
  24157. When beginning a new project, the user must add to the project his/her source files, by choosing "Add..." from the "Source" menu.  Header files are not added since after preprocessing these become part of the referencing source file(s).
  24158.  
  24159. The user must also "Add..." all the required function libraries, which are provided in precompiled form.  For example, the ANSI library contains all the ANSI standard functions for I/O, string handling, math, and memory management.  The MacTraps</span></text>
  24160.     </content>
  24161.     <content>
  24162.         <layer>background</layer>
  24163.         <id>7</id>
  24164.         <text>248</text>
  24165.     </content>
  24166.     <content>
  24167.         <layer>background</layer>
  24168.         <id>6</id>
  24169.         <text>Appendix 1.  The Think C Project </text>
  24170.     </content>
  24171.     <name></name>
  24172.     <script></script>
  24173. </card>
  24174.  
  24175.  
  24176. card_59872.xml
  24177. <?xml version="1.0" encoding="utf-8" ?>
  24178. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24179. <card>
  24180.     <id>59872</id>
  24181.     <filler1>0</filler1>
  24182.     <cantDelete> <false /> </cantDelete>
  24183.     <showPict> <true /> </showPict>
  24184.     <dontSearch> <false /> </dontSearch>
  24185.     <owner>4755</owner>
  24186.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24187.     <content>
  24188.         <layer>background</layer>
  24189.         <id>4</id>
  24190.         <text>library allows access to the Macintosh Toolbox routines, most of which are contained in the Macintosh ROMs.  The oops library contains TC's object-oriented programming extensions, discussed in Chapter 4.  The unix library provide functions useful for UNIX compatibility.  Most TC applications require at least the ANSI and oops libraries.
  24191.  
  24192. Since the ANSI library is nearly the size of a single segment (32 kbyte), it is often necessary to "drag" the ANSI library in the Project window down into a new segment.
  24193.  
  24194. To use the object-oriented extensions to ANSI C, select the "Think C + Objects" language option.  It is also recommended that the "Require prototypes" language option be selected, since this helps avoid programming errors.
  24195.  
  24196. Once the required source files and libraries have been added and the options set, the user may compile the source files and load the libraries simply by choosing "Bring Up To Date" from the Project menu.  If no compilation errors are reported the user </text>
  24197.     </content>
  24198.     <content>
  24199.         <layer>background</layer>
  24200.         <id>7</id>
  24201.         <text>249</text>
  24202.     </content>
  24203.     <name></name>
  24204.     <script></script>
  24205. </card>
  24206.  
  24207.  
  24208. card_7135.xml
  24209. <?xml version="1.0" encoding="utf-8" ?>
  24210. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24211. <card>
  24212.     <id>7135</id>
  24213.     <filler1>0</filler1>
  24214.     <cantDelete> <false /> </cantDelete>
  24215.     <showPict> <true /> </showPict>
  24216.     <dontSearch> <false /> </dontSearch>
  24217.     <owner>4755</owner>
  24218.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24219.     <content>
  24220.         <layer>background</layer>
  24221.         <id>4</id>
  24222.         <text>chooses "Run".  If no linking errors are reported (for example if the required library had not been added) the program will execute.  Choosing "Build Application..." creates a stand-alone application, if desired.
  24223.  
  24224. Refer to the Think C User's Manual for details on file/folder organization, writing, segmenting, and compiling programs, building applications, and using the debugger.
  24225.  
  24226. </text>
  24227.     </content>
  24228.     <content>
  24229.         <layer>background</layer>
  24230.         <id>7</id>
  24231.         <text>250</text>
  24232.     </content>
  24233.     <name></name>
  24234.     <script></script>
  24235. </card>
  24236.  
  24237.  
  24238. card_12288.xml
  24239. <?xml version="1.0" encoding="utf-8" ?>
  24240. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24241. <card>
  24242.     <id>12288</id>
  24243.     <filler1>0</filler1>
  24244.     <cantDelete> <false /> </cantDelete>
  24245.     <showPict> <true /> </showPict>
  24246.     <dontSearch> <false /> </dontSearch>
  24247.     <owner>4755</owner>
  24248.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24249.     <content>
  24250.         <layer>background</layer>
  24251.         <id>6</id>
  24252.         <text>Appendix 2.  C/TC/C++ Differences</text>
  24253.     </content>
  24254.     <content>
  24255.         <layer>background</layer>
  24256.         <id>7</id>
  24257.         <text>251</text>
  24258.     </content>
  24259.     <content>
  24260.         <layer>background</layer>
  24261.         <id>4</id>
  24262.         <text>Think C v. 5.0 offers complete ANSI C compatibility, a few crucial C++ features which allow object-oriented programming, and a few features not available in C++.  C++ on the other hand is mostly ANSI C compatible and adds several features not available in TC.
  24263.  
  24264. This appendix details the differences among ANSI C, Think C v. 5.0, and C++, including requirements for portability from TC to C++.  (Since C++ has many more features, it is generally difficult to port in the other direction.)
  24265.  
  24266.  
  24267. </text>
  24268.     </content>
  24269.     <name></name>
  24270.     <script></script>
  24271. </card>
  24272.  
  24273.  
  24274. card_4500.xml
  24275. <?xml version="1.0" encoding="utf-8" ?>
  24276. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24277. <card>
  24278.     <id>4500</id>
  24279.     <filler1>0</filler1>
  24280.     <cantDelete> <false /> </cantDelete>
  24281.     <showPict> <true /> </showPict>
  24282.     <dontSearch> <false /> </dontSearch>
  24283.     <owner>4755</owner>
  24284.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24285.     <content>
  24286.         <layer>background</layer>
  24287.         <id>4</id>
  24288.         <text><span class="style3">NSI C
  24289.  
  24290. The ANSI standard of C adds several features to traditional versions of C and helps to unify its development.  The most notable changes are: function prototyping, </span><span class="style4">void</span><span class="style3"> types, the </span><span class="style4">const</span><span class="style3"> and </span><span class="style4">volatile</span><span class="style3"> qualifiers, and miscellaneous library changes.
  24291.  
  24292. The Language Reference in the Think C User's Manual describes the behavior which the standard allows as "implementation defined".  Most significant to object-oriented programming is the "</span><span class="style4">#pragma once</span><span class="style3">" directive, to avoid multiple inclusion of header files.*  This directive should be avoided where portability is a concern.
  24293.  
  24294. The "Language Settings" options may be used to affect Think C's level of ANSI conformance.
  24295. </span></text>
  24296.     </content>
  24297.     <content>
  24298.         <layer>background</layer>
  24299.         <id>29</id>
  24300.         <text>54516</text>
  24301.     </content>
  24302.     <content>
  24303.         <layer>background</layer>
  24304.         <id>27</id>
  24305.         <text>Multiple header inclusion</text>
  24306.     </content>
  24307.     <content>
  24308.         <layer>background</layer>
  24309.         <id>20</id>
  24310.         <text>Multiple header inclusion - p201</text>
  24311.     </content>
  24312.     <content>
  24313.         <layer>background</layer>
  24314.         <id>7</id>
  24315.         <text>252</text>
  24316.     </content>
  24317.     <name></name>
  24318.     <script></script>
  24319. </card>
  24320.  
  24321.  
  24322. card_59314.xml
  24323. <?xml version="1.0" encoding="utf-8" ?>
  24324. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24325. <card>
  24326.     <id>59314</id>
  24327.     <filler1>0</filler1>
  24328.     <cantDelete> <false /> </cantDelete>
  24329.     <showPict> <true /> </showPict>
  24330.     <dontSearch> <false /> </dontSearch>
  24331.     <owner>4755</owner>
  24332.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24333.     <content>
  24334.         <layer>background</layer>
  24335.         <id>4</id>
  24336.         <text><span class="style3">C OBJECT EXTENSIONS
  24337.  
  24338. Think C 5.0 extends ANSI C with several C++ features, as detailed in Chapter 4.  Most importantly, the definition of a user-defined type may contain function prototypes, in which case the structure is called a </span><span class="style7">class</span><span class="style3">.  These member functions (or </span><span class="style7">methods</span><span class="style3">) may refer directly to variables which are members of the same class; that is, these </span><span class="style7">instance variables</span><span class="style3"> are said to have "class scope".
  24339.  
  24340. When a pointer to a variable of  class type is declared, the variable is called an </span><span class="style7">object</span><span class="style3">.  Space for this variable is allocated dynamically using the </span><span class="style7">free-store</span><span class="style3"> operator </span><span class="style4">new</span><span class="style3">.  (The </span><span class="style4">new()</span><span class="style3"> function was used instead in the previous version Think C 4.x.)  The variable is deallocated using the </span><span class="style4">delete</span><span class="style3"> operator.
  24341.  
  24342. Significantly, object references are usually implemented as Macintosh "handles" in TC, which requires care when taking the address of instance variables.*  This is not generally the case with C++.
  24343.  
  24344. </span></text>
  24345.     </content>
  24346.     <content>
  24347.         <layer>background</layer>
  24348.         <id>7</id>
  24349.         <text>253</text>
  24350.     </content>
  24351.     <content>
  24352.         <layer>background</layer>
  24353.         <id>29</id>
  24354.         <text>38494</text>
  24355.     </content>
  24356.     <content>
  24357.         <layer>background</layer>
  24358.         <id>27</id>
  24359.         <text>TC direct and indirect objects</text>
  24360.     </content>
  24361.     <content>
  24362.         <layer>background</layer>
  24363.         <id>20</id>
  24364.         <text>TC direct and indirect objects - p158</text>
  24365.     </content>
  24366.     <name></name>
  24367.     <script></script>
  24368. </card>
  24369.  
  24370.  
  24371. card_60082.xml
  24372. <?xml version="1.0" encoding="utf-8" ?>
  24373. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24374. <card>
  24375.     <id>60082</id>
  24376.     <filler1>0</filler1>
  24377.     <cantDelete> <false /> </cantDelete>
  24378.     <showPict> <true /> </showPict>
  24379.     <dontSearch> <false /> </dontSearch>
  24380.     <owner>4755</owner>
  24381.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24382.     <content>
  24383.         <layer>background</layer>
  24384.         <id>4</id>
  24385.         <text><span class="style3">ew classes can be defined which are derived from existing classes.  The derived classes </span><span class="style7">inherit</span><span class="style3"> all the instance variables and methods of the base class, and may add additional variables and methods or redefine ("override") an existing method.  TC provides the </span><span class="style4">inherited</span><span class="style3"> keyword ‚Äî not available in C++ ‚Äî to simplify access to the original method from within an overriding definition.
  24386.  
  24387. The scope resolution operator :: is used when defining methods and when calling methods without refering to a particular object.  The </span><span class="style4">this</span><span class="style3"> identifier is used to refer to the object receiving a message.
  24388.  
  24389. With Think C version 5.0, class definitions may include the </span><span class="style4">class</span><span class="style3"> and </span><span class="style4">virtual</span><span class="style3"> keywords.  </span><span class="style7">When the "Methods are virtual by default" option is turned off, the root class is declared with the </span><span class="style22">class</span><span class="style7"> keyword (so that the storage specifier* may be omitted), and the </span><span class="style22">inherited</span><span class="style7"> and "</span><span class="style22">#pragma once</span><span class="style7">" features are not used, it is possible for Think C programs to compile equally under C++.</span><span class="style3">
  24390.  
  24391. Version 5.0 also incorporates the C++ features of class </span><span class="style7">access control</span><span class="style3">, </span><span class="style7">constructors</span><span class="style3"> </span></text>
  24392.     </content>
  24393.     <content>
  24394.         <layer>background</layer>
  24395.         <id>7</id>
  24396.         <text>254</text>
  24397.     </content>
  24398.     <content>
  24399.         <layer>background</layer>
  24400.         <id>29</id>
  24401.         <text>43452</text>
  24402.     </content>
  24403.     <content>
  24404.         <layer>background</layer>
  24405.         <id>27</id>
  24406.         <text>Class storage specifier</text>
  24407.     </content>
  24408.     <content>
  24409.         <layer>background</layer>
  24410.         <id>20</id>
  24411.         <text>Class storage specifier - p142</text>
  24412.     </content>
  24413.     <name></name>
  24414.     <script></script>
  24415. </card>
  24416.  
  24417.  
  24418. card_66814.xml
  24419. <?xml version="1.0" encoding="utf-8" ?>
  24420. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24421. <card>
  24422.     <id>66814</id>
  24423.     <filler1>0</filler1>
  24424.     <cantDelete> <false /> </cantDelete>
  24425.     <showPict> <true /> </showPict>
  24426.     <dontSearch> <false /> </dontSearch>
  24427.     <owner>4755</owner>
  24428.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24429.     <content>
  24430.         <layer>background</layer>
  24431.         <id>4</id>
  24432.         <text><span class="style7">nd destructors</span><span class="style3">, </span><span class="style7">allocators and deallocators</span><span class="style3">, and </span><span class="style7">static members</span><span class="style3">.  Access control enhances modularity be restricting access to certain instance variables and methods of a class.  Constructors and destructors are methods which are automatically invoked when allocating and deallocating objects.  Allocators and deallocators allow the programmer to customize the creation and deletion of objects.  Instance variables and methods declared </span><span class="style4">static</span><span class="style3"> are shared by all objects of a given class.
  24433.  
  24434. TC extends ANSI C with a few non-object-oriented features.  TC supplies specialized libraries for Macintosh programming.  The storage class </span><span class="style4">pascal</span><span class="style3"> and support for Pascal string definitions simplifies access to the Macintosh Toolbox ROM routines.  C++ style comments (</span><span class="style4">//</span><span class="style3">) are now supported.
  24435.  
  24436. </span></text>
  24437.     </content>
  24438.     <content>
  24439.         <layer>background</layer>
  24440.         <id>7</id>
  24441.         <text>255</text>
  24442.     </content>
  24443.     <name></name>
  24444.     <script></script>
  24445. </card>
  24446.  
  24447.  
  24448. card_59590.xml
  24449. <?xml version="1.0" encoding="utf-8" ?>
  24450. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24451. <card>
  24452.     <id>59590</id>
  24453.     <filler1>0</filler1>
  24454.     <cantDelete> <false /> </cantDelete>
  24455.     <showPict> <true /> </showPict>
  24456.     <dontSearch> <false /> </dontSearch>
  24457.     <owner>4755</owner>
  24458.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24459.     <content>
  24460.         <layer>background</layer>
  24461.         <id>4</id>
  24462.         <text><span class="style3">++ OBJECT EXTENSIONS
  24463.  
  24464. C++ provides most of the object extensions available in TC plus additional object-oriented features.
  24465.  
  24466. Significantly, it is possible to declare identifiers which are themselves objects, rather than pointers to objects as required in TC.  Constructors may take arguments.  These features ‚Äî together with the ability to define variables at their first point of use (see below) ‚Äî simplify the problem of object allocation.
  24467.  
  24468. Access control is further customized with the </span><span class="style4">friend</span><span class="style3"> specifier.  With version 2.0, C++ offers </span><span class="style7">multiple inheritance</span><span class="style3">, where a derived class may inherit members from more than one base class.  Arguably, these capabilities complicate inter-class relationships.
  24469.  
  24470. C++ also offers several additions to ANSI C and Think C which are not directly related to object-oriented programming, as discussed below.
  24471.  
  24472. </span></text>
  24473.     </content>
  24474.     <content>
  24475.         <layer>background</layer>
  24476.         <id>7</id>
  24477.         <text>256</text>
  24478.     </content>
  24479.     <name></name>
  24480.     <script></script>
  24481. </card>
  24482.  
  24483.  
  24484. card_60577.xml
  24485. <?xml version="1.0" encoding="utf-8" ?>
  24486. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24487. <card>
  24488.     <id>60577</id>
  24489.     <filler1>0</filler1>
  24490.     <cantDelete> <false /> </cantDelete>
  24491.     <showPict> <true /> </showPict>
  24492.     <dontSearch> <false /> </dontSearch>
  24493.     <owner>4755</owner>
  24494.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24495.     <content>
  24496.         <layer>background</layer>
  24497.         <id>4</id>
  24498.         <text><span class="style3">n C++ declarations may occur anywhere within a function, rather than preceding all executable statements.  This encourages the declaration and initialization of automatic variables immediately prior to their point of use.  In addition, the "free-store" </span><span class="style4">new</span><span class="style3"> and </span><span class="style4">delete</span><span class="style3"> operators may be applied to all data types.
  24499.  
  24500. C++ provides function and operator </span><span class="style7">overloading</span><span class="style3">; that is, a function or operator may be defined to operate in a way which depends upon the context in which it is used.  This complements the polymorphism property of the object-oriented approach.
  24501.  
  24502. C++ provides the alternative I/O header file </span><span class="style18">stream.h</span><span class="style3"> which defines the overloaded operators </span><span class="style4">>></span><span class="style3"> and </span><span class="style4"><<</span><span class="style3"> for input and output.  These offer greater convenience and efficiency than </span><span class="style4">scanf()</span><span class="style3"> and </span><span class="style4">printf()</span><span class="style3"> since the processing appropriate to the given operands is selected automatically.
  24503.  
  24504. C++ functions may employ "call by reference" more conveniently than the usual technique of passing a pointer, by using </span><span class="style7">reference variables</span><span class="style3">.
  24505.  
  24506.  
  24507. </span></text>
  24508.     </content>
  24509.     <content>
  24510.         <layer>background</layer>
  24511.         <id>7</id>
  24512.         <text>257</text>
  24513.     </content>
  24514.     <name></name>
  24515.     <script></script>
  24516. </card>
  24517.  
  24518.  
  24519. card_60773.xml
  24520. <?xml version="1.0" encoding="utf-8" ?>
  24521. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24522. <card>
  24523.     <id>60773</id>
  24524.     <filler1>0</filler1>
  24525.     <cantDelete> <false /> </cantDelete>
  24526.     <showPict> <true /> </showPict>
  24527.     <dontSearch> <false /> </dontSearch>
  24528.     <owner>4755</owner>
  24529.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24530.     <content>
  24531.         <layer>background</layer>
  24532.         <id>4</id>
  24533.         <text><span class="style3">++ </span><span class="style7">inline expanded functions</span><span class="style3"> offer the efficiency of macro substitution without its associated syntactical difficulties.
  24534.  
  24535. C++ version 3.0 continues to add features, most notably </span><span class="style7">templates</span><span class="style3"> (generic types) for improved efficiency in code reuse.
  24536.  
  24537.  
  24538. </span></text>
  24539.     </content>
  24540.     <content>
  24541.         <layer>background</layer>
  24542.         <id>7</id>
  24543.         <text>258</text>
  24544.     </content>
  24545.     <name></name>
  24546.     <script></script>
  24547. </card>
  24548.  
  24549.  
  24550. card_2231.xml
  24551. <?xml version="1.0" encoding="utf-8" ?>
  24552. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24553. <card>
  24554.     <id>2231</id>
  24555.     <filler1>0</filler1>
  24556.     <cantDelete> <false /> </cantDelete>
  24557.     <showPict> <true /> </showPict>
  24558.     <dontSearch> <false /> </dontSearch>
  24559.     <owner>4755</owner>
  24560.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24561.     <content>
  24562.         <layer>background</layer>
  24563.         <id>7</id>
  24564.         <text>259</text>
  24565.     </content>
  24566.     <content>
  24567.         <layer>background</layer>
  24568.         <id>6</id>
  24569.         <text>Bibliography</text>
  24570.     </content>
  24571.     <content>
  24572.         <layer>background</layer>
  24573.         <id>4</id>
  24574.         <text>Booch, Grady, "Object-Oriented Design", Benjamin-Cummings, CA, 1991
  24575.  
  24576. Coad, Peter; Yourdon, Edward, "Object-Oriented Analysis", Prentice-Hall, NJ, 1990
  24577.  
  24578. Gardner, James, "From C to C:  an introduction to ANSI Standard C", Harcourt Brace Jovanovich, CA, 1989
  24579.  
  24580. Kernighan, B.; Ritchie, D., "The C Programming Language", Prentice-Hall, NJ, 1989
  24581.  
  24582. Meyer, Bertrand, "Object-Oriented Software Construction", Prentic-Hall, NJ, 1988
  24583.  
  24584. Miller, Lawrence H.; Quilici, Alexander E., "Programming in C", Wiley, NY, 1986
  24585.  
  24586. Mark, Dave., "Learn C on the Macintosh", Addison-Wesley, MA 1991
  24587.  
  24588. Mark, D.; Reed, C., "Macintosh Programming Primer", Addison-Wesley, MA, 1989
  24589.  
  24590.  
  24591.  
  24592. </text>
  24593.     </content>
  24594.     <name></name>
  24595.     <script></script>
  24596. </card>
  24597.  
  24598.  
  24599. card_52892.xml
  24600. <?xml version="1.0" encoding="utf-8" ?>
  24601. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24602. <card>
  24603.     <id>52892</id>
  24604.     <filler1>0</filler1>
  24605.     <cantDelete> <false /> </cantDelete>
  24606.     <showPict> <true /> </showPict>
  24607.     <dontSearch> <false /> </dontSearch>
  24608.     <owner>4755</owner>
  24609.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24610.     <content>
  24611.         <layer>background</layer>
  24612.         <id>4</id>
  24613.         <text>Shafer, Dan, "HyperTalk Programming", Hayden Books, IN, 1988
  24614.  
  24615. Stroustrup, Bjarne, "The C++ Programming Language", Addison-Wesley, MA, 1986
  24616. </text>
  24617.     </content>
  24618.     <content>
  24619.         <layer>background</layer>
  24620.         <id>7</id>
  24621.         <text>260</text>
  24622.     </content>
  24623.     <name></name>
  24624.     <script></script>
  24625. </card>
  24626.  
  24627.  
  24628. card_6390.xml
  24629. <?xml version="1.0" encoding="utf-8" ?>
  24630. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24631. <card>
  24632.     <id>6390</id>
  24633.     <filler1>0</filler1>
  24634.     <cantDelete> <true /> </cantDelete>
  24635.     <showPict> <true /> </showPict>
  24636.     <dontSearch> <false /> </dontSearch>
  24637.     <owner>4755</owner>
  24638.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24639.     <part>
  24640.         <id>1</id>
  24641.         <type>field</type>
  24642.         <visible> <true /> </visible>
  24643.         <dontWrap> <false /> </dontWrap>
  24644.         <dontSearch> <false /> </dontSearch>
  24645.         <sharedText> <false /> </sharedText>
  24646.         <fixedLineHeight> <false /> </fixedLineHeight>
  24647.         <autoTab> <false /> </autoTab>
  24648.         <lockText> <false /> </lockText>
  24649.         <rect>
  24650.             <left>14</left>
  24651.             <top>60</top>
  24652.             <right>494</right>
  24653.             <bottom>300</bottom>
  24654.         </rect>
  24655.         <style>transparent</style>
  24656.         <autoSelect> <false /> </autoSelect>
  24657.         <showLines> <false /> </showLines>
  24658.         <wideMargins> <false /> </wideMargins>
  24659.         <multipleLines> <false /> </multipleLines>
  24660.         <reservedFamily> 0 </reservedFamily>
  24661.         <titleWidth>0</titleWidth>
  24662.         <icon>0</icon>
  24663.         <textAlign>left</textAlign>
  24664.         <font>Geneva</font>
  24665.         <textSize>12</textSize>
  24666.         <textStyle>plain</textStyle>
  24667.         <textHeight>16</textHeight>
  24668.         <name>notes</name>
  24669.         <script></script>
  24670.     </part>
  24671.     <part>
  24672.         <id>5</id>
  24673.         <type>button</type>
  24674.         <visible> <true /> </visible>
  24675.         <reserved5> 0 </reserved5>
  24676.         <reserved4> 0 </reserved4>
  24677.         <reserved3> 0 </reserved3>
  24678.         <reserved2> 0 </reserved2>
  24679.         <reserved1> 0 </reserved1>
  24680.         <enabled> <true /> </enabled>
  24681.         <rect>
  24682.             <left>352</left>
  24683.             <top>26</top>
  24684.             <right>470</right>
  24685.             <bottom>43</bottom>
  24686.         </rect>
  24687.         <style>roundrect</style>
  24688.         <showName> <true /> </showName>
  24689.         <highlight> <false /> </highlight>
  24690.         <autoHighlight> <true /> </autoHighlight>
  24691.         <sharedHighlight> <true /> </sharedHighlight>
  24692.         <family>0</family>
  24693.         <titleWidth>0</titleWidth>
  24694.         <icon>0</icon>
  24695.         <textAlign>center</textAlign>
  24696.         <font>Chicago</font>
  24697.         <textSize>12</textSize>
  24698.         <textStyle>plain</textStyle>
  24699.         <name>Add Notes Pg.</name>
  24700.         <script>on mouseUp
  24701. put the userLevel into currentLevel
  24702. set the userLevel to 5
  24703. doMenu "Copy Card"
  24704. doMenu "Paste Card"
  24705. put "Notes (cont.)" into field "heading"
  24706. put "" into card field "notes"
  24707. put "" into field "page no"
  24708. set the cantdelete of this card to false
  24709. send updateNotesPg
  24710. updateBookmarks (the number of this card)
  24711. send showBookmarks
  24712. set the userLevel to currentLevel
  24713. end mouseUp
  24714. </script>
  24715.     </part>
  24716.     <content>
  24717.         <layer>background</layer>
  24718.         <id>7</id>
  24719.         <text>261</text>
  24720.     </content>
  24721.     <content>
  24722.         <layer>background</layer>
  24723.         <id>6</id>
  24724.         <text>Notes</text>
  24725.     </content>
  24726.     <content>
  24727.         <layer>card</layer>
  24728.         <id>1</id>
  24729.         <text>
  24730.  
  24731.  
  24732.  
  24733.  
  24734.  
  24735. </text>
  24736.     </content>
  24737.     <name>notes</name>
  24738.     <script>on updateNotesPg
  24739. put the number of me into currentCard
  24740. get field "page no" of card currentCard - 1
  24741. add 1 to it
  24742. put it into field "page no" of card currentCard
  24743. put currentCard + 1 into nextCard
  24744. if nextCard <= the number of cards then
  24745. get the name of card nextCard
  24746. get word 2 of it
  24747. get char 2 to 6 of it
  24748. if it is "notes" then
  24749. send updateNotesPg to card nextCard
  24750. end if
  24751. end if
  24752. end updateNotesPg</script>
  24753. </card>
  24754.  
  24755.  
  24756. card_5508.xml
  24757. <?xml version="1.0" encoding="utf-8" ?>
  24758. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  24759. <card>
  24760.     <id>5508</id>
  24761.     <filler1>0</filler1>
  24762.     <bitmap>BMAP_5768.pbm</bitmap>
  24763.     <cantDelete> <true /> </cantDelete>
  24764.     <showPict> <true /> </showPict>
  24765.     <dontSearch> <false /> </dontSearch>
  24766.     <owner>2698</owner>
  24767.     <link rel="stylesheet" type="text/css" href="stylesheet_7572.css" />
  24768.     <part>
  24769.         <id>4</id>
  24770.         <type>button</type>
  24771.         <visible> <true /> </visible>
  24772.         <reserved5> 0 </reserved5>
  24773.         <reserved4> 0 </reserved4>
  24774.         <reserved3> 0 </reserved3>
  24775.         <reserved2> 0 </reserved2>
  24776.         <reserved1> 0 </reserved1>
  24777.         <enabled> <true /> </enabled>
  24778.         <rect>
  24779.             <left>26</left>
  24780.             <top>36</top>
  24781.             <right>486</right>
  24782.             <bottom>302</bottom>
  24783.         </rect>
  24784.         <style>rectangle</style>
  24785.         <showName> <false /> </showName>
  24786.         <highlight> <false /> </highlight>
  24787.         <autoHighlight> <false /> </autoHighlight>
  24788.         <sharedHighlight> <true /> </sharedHighlight>
  24789.         <family>0</family>
  24790.         <titleWidth>0</titleWidth>
  24791.         <icon>0</icon>
  24792.         <textAlign>center</textAlign>
  24793.         <font>Chicago</font>
  24794.         <textSize>12</textSize>
  24795.         <textStyle>plain</textStyle>
  24796.         <name></name>
  24797.         <script>on mouseUp
  24798. end mouseUp
  24799. </script>
  24800.     </part>
  24801.     <part>
  24802.         <id>1</id>
  24803.         <type>field</type>
  24804.         <visible> <true /> </visible>
  24805.         <dontWrap> <false /> </dontWrap>
  24806.         <dontSearch> <false /> </dontSearch>
  24807.         <sharedText> <false /> </sharedText>
  24808.         <fixedLineHeight> <true /> </fixedLineHeight>
  24809.         <autoTab> <false /> </autoTab>
  24810.         <lockText> <false /> </lockText>
  24811.         <rect>
  24812.             <left>38</left>
  24813.             <top>70</top>
  24814.             <right>470</right>
  24815.             <bottom>298</bottom>
  24816.         </rect>
  24817.         <style>transparent</style>
  24818.         <autoSelect> <false /> </autoSelect>
  24819.         <showLines> <false /> </showLines>
  24820.         <wideMargins> <false /> </wideMargins>
  24821.         <multipleLines> <false /> </multipleLines>
  24822.         <reservedFamily> 0 </reservedFamily>
  24823.         <titleWidth>0</titleWidth>
  24824.         <icon>0</icon>
  24825.         <textAlign>left</textAlign>
  24826.         <font>Geneva</font>
  24827.         <textSize>12</textSize>
  24828.         <textStyle>plain</textStyle>
  24829.         <textHeight>16</textHeight>
  24830.         <name>description</name>
  24831.         <script></script>
  24832.     </part>
  24833.     <part>
  24834.         <id>2</id>
  24835.         <type>field</type>
  24836.         <visible> <true /> </visible>
  24837.         <dontWrap> <false /> </dontWrap>
  24838.         <dontSearch> <false /> </dontSearch>
  24839.         <sharedText> <false /> </sharedText>
  24840.         <fixedLineHeight> <true /> </fixedLineHeight>
  24841.         <autoTab> <false /> </autoTab>
  24842.         <lockText> <false /> </lockText>
  24843.         <rect>
  24844.             <left>126</left>
  24845.             <top>41</top>
  24846.             <right>380</right>
  24847.             <bottom>70</bottom>
  24848.         </rect>
  24849.         <style>transparent</style>
  24850.         <autoSelect> <false /> </autoSelect>
  24851.         <showLines> <false /> </showLines>
  24852.         <wideMargins> <false /> </wideMargins>
  24853.         <multipleLines> <false /> </multipleLines>
  24854.         <reservedFamily> 0 </reservedFamily>
  24855.         <titleWidth>0</titleWidth>
  24856.         <icon>0</icon>
  24857.         <textAlign>center</textAlign>
  24858.         <font>Palatino</font>
  24859.         <textSize>18</textSize>
  24860.         <textStyle>plain</textStyle>
  24861.         <textHeight>24</textHeight>
  24862.         <name>title</name>
  24863.         <script></script>
  24864.     </part>
  24865.     <part>
  24866.         <id>5</id>
  24867.         <type>button</type>
  24868.         <visible> <true /> </visible>
  24869.         <reserved5> 0 </reserved5>
  24870.         <reserved4> 0 </reserved4>
  24871.         <reserved3> 0 </reserved3>
  24872.         <reserved2> 0 </reserved2>
  24873.         <reserved1> 0 </reserved1>
  24874.         <enabled> <true /> </enabled>
  24875.         <rect>
  24876.             <left>24</left>
  24877.             <top>34</top>
  24878.             <right>488</right>
  24879.             <bottom>304</bottom>
  24880.         </rect>
  24881.         <style>transparent</style>
  24882.         <showName> <false /> </showName>
  24883.         <highlight> <false /> </highlight>
  24884.         <autoHighlight> <false /> </autoHighlight>
  24885.         <sharedHighlight> <true /> </sharedHighlight>
  24886.         <family>0</family>
  24887.         <titleWidth>0</titleWidth>
  24888.         <icon>0</icon>
  24889.         <textAlign>center</textAlign>
  24890.         <font>Chicago</font>
  24891.         <textSize>12</textSize>
  24892.         <textStyle>plain</textStyle>
  24893.         <name>hide</name>
  24894.         <script>on mouseUp
  24895. visual dissolve
  24896. go card "contents"
  24897. end mouseUp
  24898. </script>
  24899.     </part>
  24900.     <part>
  24901.         <id>3</id>
  24902.         <type>button</type>
  24903.         <visible> <true /> </visible>
  24904.         <reserved5> 0 </reserved5>
  24905.         <reserved4> 0 </reserved4>
  24906.         <reserved3> 0 </reserved3>
  24907.         <reserved2> 0 </reserved2>
  24908.         <reserved1> 0 </reserved1>
  24909.         <enabled> <true /> </enabled>
  24910.         <rect>
  24911.             <left>162</left>
  24912.             <top>311</top>
  24913.             <right>233</right>
  24914.             <bottom>333</bottom>
  24915.         </rect>
  24916.         <style>roundrect</style>
  24917.         <showName> <true /> </showName>
  24918.         <highlight> <false /> </highlight>
  24919.         <autoHighlight> <true /> </autoHighlight>
  24920.         <sharedHighlight> <true /> </sharedHighlight>
  24921.         <family>0</family>
  24922.         <titleWidth>0</titleWidth>
  24923.         <icon>0</icon>
  24924.         <textAlign>center</textAlign>
  24925.         <font>Chicago</font>
  24926.         <textSize>12</textSize>
  24927.         <textStyle>plain</textStyle>
  24928.         <name>Contents</name>
  24929.         <script>on mouseUp
  24930. visual dissolve
  24931. go card "contents"
  24932. end mouseUp
  24933. </script>
  24934.     </part>
  24935.     <part>
  24936.         <id>6</id>
  24937.         <type>button</type>
  24938.         <visible> <true /> </visible>
  24939.         <reserved5> 0 </reserved5>
  24940.         <reserved4> 0 </reserved4>
  24941.         <reserved3> 0 </reserved3>
  24942.         <reserved2> 0 </reserved2>
  24943.         <reserved1> 0 </reserved1>
  24944.         <enabled> <true /> </enabled>
  24945.         <rect>
  24946.             <left>262</left>
  24947.             <top>311</top>
  24948.             <right>345</right>
  24949.             <bottom>333</bottom>
  24950.         </rect>
  24951.         <style>roundrect</style>
  24952.         <showName> <true /> </showName>
  24953.         <highlight> <false /> </highlight>
  24954.         <autoHighlight> <true /> </autoHighlight>
  24955.         <sharedHighlight> <true /> </sharedHighlight>
  24956.         <family>0</family>
  24957.         <titleWidth>0</titleWidth>
  24958.         <icon>0</icon>
  24959.         <textAlign>center</textAlign>
  24960.         <font>Chicago</font>
  24961.         <textSize>12</textSize>
  24962.         <textStyle>plain</textStyle>
  24963.         <name>Help Stack</name>
  24964.         <script>on mouseUp
  24965. global gettingHelp
  24966. answer "Go to Help stack?" with "Cancel" or "OK"
  24967. if it is "OK" then
  24968. put true into gettingHelp
  24969. visual dissolve to black
  24970. visual dissolve
  24971. go "Help"
  24972. end if
  24973. end mouseUp
  24974. </script>
  24975.     </part>
  24976.     <part>
  24977.         <id>7</id>
  24978.         <type>button</type>
  24979.         <visible> <false /> </visible>
  24980.         <reserved5> 0 </reserved5>
  24981.         <reserved4> 0 </reserved4>
  24982.         <reserved3> 0 </reserved3>
  24983.         <reserved2> 0 </reserved2>
  24984.         <reserved1> 0 </reserved1>
  24985.         <enabled> <true /> </enabled>
  24986.         <rect>
  24987.             <left>453</left>
  24988.             <top>308</top>
  24989.             <right>485</right>
  24990.             <bottom>336</bottom>
  24991.         </rect>
  24992.         <style>transparent</style>
  24993.         <showName> <false /> </showName>
  24994.         <highlight> <false /> </highlight>
  24995.         <autoHighlight> <false /> </autoHighlight>
  24996.         <sharedHighlight> <true /> </sharedHighlight>
  24997.         <family>0</family>
  24998.         <titleWidth>0</titleWidth>
  24999.         <icon>2162</icon>
  25000.         <textAlign>center</textAlign>
  25001.         <font>Chicago</font>
  25002.         <textSize>12</textSize>
  25003.         <textStyle>plain</textStyle>
  25004.         <name>return</name>
  25005.         <script>on mouseUp
  25006. get card field "return card"
  25007. visual iris close
  25008. go it
  25009. end mouseUp
  25010. </script>
  25011.     </part>
  25012.     <part>
  25013.         <id>8</id>
  25014.         <type>field</type>
  25015.         <visible> <false /> </visible>
  25016.         <dontWrap> <false /> </dontWrap>
  25017.         <dontSearch> <false /> </dontSearch>
  25018.         <sharedText> <false /> </sharedText>
  25019.         <fixedLineHeight> <true /> </fixedLineHeight>
  25020.         <autoTab> <false /> </autoTab>
  25021.         <lockText> <false /> </lockText>
  25022.         <rect>
  25023.             <left>145</left>
  25024.             <top>18</top>
  25025.             <right>360</right>
  25026.             <bottom>35</bottom>
  25027.         </rect>
  25028.         <style>opaque</style>
  25029.         <autoSelect> <false /> </autoSelect>
  25030.         <showLines> <false /> </showLines>
  25031.         <wideMargins> <false /> </wideMargins>
  25032.         <multipleLines> <false /> </multipleLines>
  25033.         <reservedFamily> 0 </reservedFamily>
  25034.         <titleWidth>0</titleWidth>
  25035.         <icon>0</icon>
  25036.         <textAlign>left</textAlign>
  25037.         <font>Geneva</font>
  25038.         <textSize>12</textSize>
  25039.         <textStyle>plain</textStyle>
  25040.         <textHeight>16</textHeight>
  25041.         <name>return card</name>
  25042.         <script></script>
  25043.     </part>
  25044.     <content>
  25045.         <layer>card</layer>
  25046.         <id>1</id>
  25047.         <text>
  25048.     This stack is based on Bookbinder, a $10 shareware stack by Ralph Gonzalez, PO Box 54, Newark, DE 19711.  Press the buttons to view new pages.  The left and right arrow buttons will move you one page at a time.  An asterix (*) in the text indicates a relevant button or footnote at the bottom of the page.  After pressing this button, the bent arrow returns you to the page you were reading.  Press the book icon to insert a bookmark at a page, so you can return to that page at a later date.
  25049.     
  25050.     You may obtain a hard copy of the stack by using HyperCard's Print Stack feature in the File menu.</text>
  25051.     </content>
  25052.     <content>
  25053.         <layer>card</layer>
  25054.         <id>2</id>
  25055.         <text>Bookbinder</text>
  25056.     </content>
  25057.     <name>help</name>
  25058.     <script>on openCard
  25059. if card field "return card" is "" then
  25060. hide card button "return"
  25061. else
  25062. show card button "return"
  25063. end if
  25064. end openCard
  25065.  
  25066. on closeCard
  25067. global gettingHelp
  25068. if gettingHelp is false then
  25069. put "" into card field "return card" of card "help"
  25070. end if
  25071. end closeCard</script>
  25072. </card>
  25073.  
  25074.  
  25075.